sed flat file manipulation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed flat file manipulation
# 1  
Old 12-11-2014
sed flat file manipulation

Hello, I have a large flat file where i need to change data in columns 131-133 based on what is in columns 172-173. I am not sure if I need to read the file line by line and make the change or if I can do this in a single statement. thank you
# 2  
Old 12-11-2014
If you want to do the change in every line, you'll need to read and modify every single line.
# 3  
Old 12-11-2014
ok thank you
# 4  
Old 12-11-2014
But, the program to read every single line, modify it, and write it back out might still be a single line.

If you'd give us sample input, a description of the rules that specify what changes are to be made, and sample output; we might be able to help you solve your problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

File manipulation place 0 before the number using sed

I'm new with sed, and i am really confused with slashes, backslashes, parentheses, I've tried reading some beginner's guide, but still trouble fixing this problem, do you have any tips where or what to read to learn more about sed? can you also help me with my problem? Note: I was tasked to use... (4 Replies)
Discussion started by: akopocpoypoy
4 Replies

2. Shell Programming and Scripting

SED | Awk flat file one liner

sed awk one liner (2 Replies)
Discussion started by: jap2614
2 Replies

3. Shell Programming and Scripting

SED/AWK file read & manipulation

I have large number of data files, close to 300 files, lets say all files are same kind and have extension .dat , each file have mulitple lines in it. There is a unique line in each file containing string 'SERVER'. Right after this line there is another line which contain a string 'DIGIT=0',... (4 Replies)
Discussion started by: sal_tx
4 Replies

4. Shell Programming and Scripting

File manipulation with AWK and SED

Hello How do i check that correct input files are used while using AWk and SED for file manipulation? e.g awk '/bin/ {print $0 }' shell.txt sed 's/hp/samsung/' printers.txt how do i ensure that the correct input files I am working with are used? (5 Replies)
Discussion started by: Pauline mugisha
5 Replies

5. Shell Programming and Scripting

Flat file manipulation

Hi I have flat file with 100 records ,I need to fabricate data into flat file . ex: file.txt 102345 1000 200 300 ............................... .............................. 102346 2000 300 4000 In above file the 4th row, 1 st column valu to be increment by 1 and rest of... (13 Replies)
Discussion started by: mohan705
13 Replies

6. Shell Programming and Scripting

Flat File column manipulation

Hi All, I have a tab delimited input file with say 4 fields (columns) as below : 0000443 1AGPR061 2006 Daiml 0002198 1B3XG0K2 1989 Chdds 0002199 1Bd64J0L 1990 Ch34s 0002275 1B3s4J0K 1989 Chadys 0002276 1B465302 2002 Dageml 0002290 1B45430K 1989 Cays I want the 2nd column in file to... (5 Replies)
Discussion started by: net
5 Replies

7. Shell Programming and Scripting

How to delimit a flat file with records with SED

Hi gurus, hoping someone can help with a sed line that can do the following... I have a flat file with about 1000 records, but in order to import into openoffice spreadsheet, I need to create a delimited file. I'd like to do 2 things with the SED command: 1- add a pipe character "|" at the end... (4 Replies)
Discussion started by: RogCor
4 Replies

8. Shell Programming and Scripting

Flat file manipulation, (this could be a tough one)

Howdy everyone, I have need of a scripting brain to help me through the following issue: *This will help if I explain what I am doing this for and then it may make sense. I need to change a flat file to prepend a 3 digit code to a certain field in the file going on the value in another scetion of... (2 Replies)
Discussion started by: mrbungle50
2 Replies

9. UNIX for Dummies Questions & Answers

Problems with sed and flat file variables

Hello All, It has been a loooooooooooong time since I had last used sed but decided to use it for a simple task I have . My goal is to use sed to read variables from a flat file then use those same variables in order to make some subsitutions. However what I am finding is that when the... (1 Reply)
Discussion started by: icalderus
1 Replies

10. Shell Programming and Scripting

file name Manipulation using sed

Hi, I have a file name, for which I want to strip out the first bit and leave the rest... So I want to take the file name .lockfile-filename.10001 ,strip it and have only filename.10001 ... Thanking you all inadvance, Zak (6 Replies)
Discussion started by: Zak
6 Replies
Login or Register to Ask a Question