Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need tips on file manipulation Post 302365089 by saltysumi on Monday 26th of October 2009 01:08:40 AM
Old 10-26-2009
sample data

00044779
aaaaaaaaaaaaaaaaaaaaaaaaaa
ccccccccccccccccccccccccccc
vvvvvvvvvvvvvvvvvvvvvvv
bbbbbbbbbbbbbbbbbbbbbbb
00044898
ccccccccccccccccccccccccccc
vvvvvvvvvvvvvvvvvvvvvvv
bbbbbbbbbbbbbbbbbbbbbbb
00044799
sssssssssssssssss
dddddddddddddd
gggggggggggggg
hhhhhhhhhhhhhhh
hhhhhhhhhhhhhh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File manipulation

I'm new to Unix and want to know if this type of file processing is feasible. I have a master file downloaded on Sundays. From Monday to Saturday a file containing changes and adds and a file containing deletes are downloaded. I'd like to apply the mon-sat files to the master file so that I do not... (3 Replies)
Discussion started by: ssp7423
3 Replies

2. Shell Programming and Scripting

File manipulation

To all Guru I have a file like test.txt 111,122,212,123 data11,date12, data13, data14...data1n data21,date22, data23, data24...data2n data31,date32, data33, data34...data3n ... ... .. datan1,daten2, datan3, datan4...datann END I have to load this data into oracle , where first... (1 Reply)
Discussion started by: u263066
1 Replies

3. Shell Programming and Scripting

file manipulation

Hi, I have a file with 3 lines like aaaabb abcdef wertyu now i want to insert a new character "Q" in the 3rd position of every line of the file.... I found a way to do it but i felt it is little complex. Do you guys have any ideas (4 Replies)
Discussion started by: siddu_chittari
4 Replies

4. Shell Programming and Scripting

File Manipulation

Hi, i have a file with fixed record length with the following content (only one sentence) 12345678901234567890123456789012345678901234567890 12345678 87654321 hugo meyer friedhofpaul the numbers above are only the column-positions and not part of the file! Now i want... (2 Replies)
Discussion started by: FranzB
2 Replies

5. Shell Programming and Scripting

File manipulation

Hello, I have a file of which six lines are given below: <a="b" value="N"/> <a="c" value="x1"/> <a="b" value="N"/> <a="c" value="x2"/> <a="b" value="Y"/> <a="c" value="x3"/> I need one file with all the lines just below where value="N"... (4 Replies)
Discussion started by: shekhar2010us
4 Replies

6. UNIX for Dummies Questions & Answers

file manipulation

Is there a way to cp/mv a set of files in a directory + sub directories without cp/mv'ing the sub-directories as well? eg. To copy all the *.pdf files in a directory + sub directory into a specified folder i would invoke " cp -R *.pdf ~/Home/ however, this would copy the subdirectories as... (4 Replies)
Discussion started by: grkness
4 Replies

7. UNIX for Dummies Questions & Answers

Filtering records from 1 file based on some manipulation doen on second file

Hi, I am looking for an awk script which should help me to meet the following requirement: File1 has records in following format INF: FAILEd RECORD AB1234 INF: FAILEd RECORD PQ1145 INF: FAILEd RECORD AB3215 INF: FAILEd RECORD AB6114 ............................ (2 Replies)
Discussion started by: mintu41
2 Replies

8. Shell Programming and Scripting

Awk to convert a text file to CSV file with some string manipulation

Hi , I have a simple text file with contents as below: 12345678900 971,76 4234560890 22345678900 5971,72 5234560990 32345678900 71,12 6234560190 the new csv-file should be like: Column1;Column2;Column3;Column4;Column5 123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies

9. Shell Programming and Scripting

Populating File data with custom manipulation on file names

Hi, I am confused how to proceed firther please find the problem below: Input Files: DCIA_GEOG_DATA_OCEAN.TXT DCIA_GEOG_DATA_MCRO.TXT DCIA_GEOG_DATA_CVAS.TXT DCIA_GEOG_DATA_MCR.TXT Output File Name: MMA_RFC_GEOG_NAM_DIM_LOD.txt Sample Record(DCIA_GEOG_DATA_OCEAN.TXT):(Layout same for... (4 Replies)
Discussion started by: Arun Mishra
4 Replies

10. Shell Programming and Scripting

File manipulation

Hi, I want to update the file with a value at a particular position $cat test.txt COL1=TEST COL2= COL3=AADSDFSDFDSFDFDF I want to update the file with a value for COL2. After update, the file should be like this $cat test.txt COL1=TEST COL2=1 COL3=AADSDFSDFDSFDFDF here 1... (9 Replies)
Discussion started by: vedanta
9 Replies
yaml(3tcl)							  YAML processing							yaml(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
yaml - YAML Format Encoder/Decoder SYNOPSIS
package require Tcl 8.4 package require yaml ?0.3.6? ::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.6 yaml(3tcl)
All times are GMT -4. The time now is 01:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy