I have files and have a missing record. I need copy the existing record and mark those values up. For example in the below file 11048 is missing. I need to copy 22001 and copy those create the values for 11048. I have 120 set of files and I need to do that on all files.
Note the only ID I am missing is 11048 and I have to copy the 22001 to it. There are 120 files I have to do which will be on name file1,file2 ----file120
File 1
Expected File1
Last edited by arunkumar_mca; 03-24-2018 at 12:04 AM..
Reason: Added more details
Hello,
The following sed command is giving error
sed: -e expression #1, char 13: unknown option to `s'
The sed command is
echo "//-----" | sed "s/\/\/---*/$parChk/g"
where parChk="//---ee-"
How can i print the variable value from sed command ?
And is it possible to replace a... (2 Replies)
Hi,
I have a situation where I want to replace some occurrences of ".jsp" into ".html" inside a text file.
For Example:
If a pattern found like <a href="http://www.mysite.com/mypage.jsp"> it should be retained.
But if a pattern found like <a href="../mypage.jsp"> it should be changed to... (4 Replies)
hello everybody,
I have a group of file
eg-
sample1
sample2
sample3
sample4
each file contain this :-
cat sample1
SEQ_NUM,1,UPESI1
My requirement is to
change the value-UPESI1 to UPE10 in file which contain this pattern -UPESI1.
any help is appreciated. (2 Replies)
Hi
Guys , I am new to this and Hi to all ,Need your help
I am trying to copy Files which are inside file.txt
The files inside file.txt are inthe below order
file1.log
file2.log
file3.log
.......
I want to copy these files to an output Directory ,
Please help (1 Reply)
Hi
Guys , I am new to this and Hi to all ,Need your help
I am trying to copy Files which are inside file.txt
The files inside file.txt are inthe below order
file1.log
file2.log
file3.log
.......
I want to copy these files to an output Directory ,
Please help (1 Reply)
I have a huge file that has roughly 30304 lines. I need to extract specific info from that file. For example,
Box 1 > *aaaaaaaajjjj*
> hbbvjvj
> jdnnfddllll
> *dgdfhfekwjh*
Box 2 > *aaaaaaa'aj'jjj*
> dse hkjuejef bfdw
> dyeee
> dsewq
> *dgdfhfekwjh*
>feweiuei
Box 3 > *aaaa"aaaaj"jjj*
>... (25 Replies)
i have little challenge, help me out.i have a file where i have a value declared and and i have to replace the value when called. for example i have the value for abc and ccc. now i have to substitute the value of
value abc and ccc in the place of them.
Input File:
go to &abc=ddd;
if... (16 Replies)
I have a really big XML file. I need copy the value of one tag inside another one tag. I try to publish one example.
<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1">Rai 1</channel>
<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1 +2HD">Rai 1... (6 Replies)
How to grep for searching a string within a begin and end pattern of a file.
Sent from my Redmi 3S using Tapatalk (8 Replies)
Discussion started by: Baishali
8 Replies
LEARN ABOUT OSX
yaml
yaml(n) YAML processing yaml(n)
__________________________________________________________________________________________________________________________________________________NAME
yaml - YAML Format Encoder/Decoder
SYNOPSIS
package require Tcl 8.4
package require yaml ?0.3.5?
::yaml::yaml2dict ?options? txt
::yaml::yaml2huddle ?options? txt
::yaml::setOption ?options?
::yaml::dict2yaml dict ?indent? ?wordwrap?
::yaml::list2yaml list ?indent? ?wordwrap?
::yaml::huddle2yaml huddle ?indent? ?wordwrap?
_________________________________________________________________DESCRIPTION
The yaml package provides a simple Tcl-only library for parsing the YAML http://www.yaml.org/ data exchange format as specified in
http://www.yaml.org/spec/1.1/.
The yaml package returns data as a Tcl dict. Either the dict package or Tcl 8.5 is required for use.
COMMANDS
::yaml::yaml2dict ?options? txt
::yaml::yaml2huddle ?options? txt
Parse yaml formatted text txt into a Tcl dict/huddle and return the value.
-file txt is a filename of YAML-stream.
-stream
txt is just a YAML-stream.
-types list
The list is a type list for the yaml-scalar types.(e.g. !!str !!timestamp !!integer !!true ...)
-types {timestamp integer null true false}
In this case, if a string matched "timestamp", converted to the TCL internal timestamp.(e.g. "2001-12-15T02:59:43.1Z" =>
1008385183)
-m:true param
The param is two elements of list for the value of true, and considered strings.
-m:true {1 {true on + yes y}}
In this case, the string "yes" found in YAML Stream, automatically converted 1.
-m:false param
The param is two elements of list for the value of false, and considered strings.
-m:false {0 {false off - no n}}
-m:null param
The param is two elements of list for the value of null, and considered strings.
-m:null {"" {null nil "" ~}}
-validate
Experiment,old: Output stream contains YAML's-tag, each node.
% puts [::yaml::load -validate {[aaa, bbb]}]
=>
!!seq {{!!str aaa} {!!str bbb}}
::yaml::setOption ?options?
Change implicit options for the library. Now, the params are the same as ::yaml::yaml2dict. Arguments of::yaml::yaml2dict is more
priority than this setting.
::yaml::dict2yaml dict ?indent? ?wordwrap?
::yaml::list2yaml list ?indent? ?wordwrap?
::yaml::huddle2yaml huddle ?indent? ?wordwrap?
Convert a dict/list/huddle object into YAML stream.
indent spaces indent of each block node. currently default is 2.
wordwrap
word wrap for YAML stream. currently default is 40.
EXAMPLES
An example of a yaml stream converted to Tcl. A yaml stream is returned as a single item with multiple elements.
{
--- !<tag:clarkevans.com,2002:invoice>
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292
city : Royal Oak
state : MI
postal : 48046
ship-to: *id001
product:
- sku : BL394D
quantity : 4
description : Basketball
price : 450.00
- sku : BL4438H
quantity : 1
description : Super Hoop
price : 2392.00
tax : 251.42
total: 4443.52
comments:
Late afternoon is best.
Backup contact is Nancy
Billsmer @ 338-4338.
}
=>
invoice 34843 date 2001-01-23 bill-to {given Chris family Dumars address {lines {458 Walkman Dr.
Suite #292
} city {Royal Oak} state MI postal 48046}} ship-to {given Chris family Dumars address {lines {458 Walkman Dr.
Suite #292
} city {Royal Oak} state MI postal 48046}} product {{sku BL394D quantity 4 description Basketball price 450.00} {sku BL4438H quantity 1 description {Super Hoop} price 2392.00}} tax 251.42 total 4443.52 comments {Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.}
An example of a yaml object converted to Tcl. A yaml object is returned as a multi-element list (a dict).
{
---
- [name , hr, avg ]
- [Mark McGwire, 65, 0.278]
- [Sammy Sosa , 63, 0.288]
-
Mark McGwire: {hr: 65, avg: 0.278}
Sammy Sosa: { hr: 63, avg: 0.288}
}
=>
{name hr avg} {{Mark McGwire} 65 0.278} {{Sammy Sosa} 63 0.288} {{Mark McGwire} {hr 65 avg 0.278} {Sammy Sosa} {hr 63 avg 0.288}}
LIMITATIONS
tag parser not implemented. currentry, tags are merely ignored.
Only Anchor => Aliases ordering. back alias-referring is not supported.
Too many braces, or too few braces.
Not enough character set of line feeds. Please use only "
" as line breaks.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category yaml of
the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
SEE ALSO
base64, huddle, json
KEYWORDS
data exchange, huddle, parsing, text processing, yaml
COPYRIGHT
Copyright (c) 2008 KATO Kanryu <kanryu6@users.sourceforge.net>
yaml 0.3.5 yaml(n)