| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Insert a line to many files
|
Original Message
|
Name: hismail
Date: September 6, 2005 at 08:27:26 Pacific
Subject: Insert a line to many files OS: Sco OpenserCPU/Ram: 2 gig /2 gig |
Comment: Hi I would like to insert a line to many files in a directory : for example: abc has to be inserted to files harry.pf barry.pf tom.pf The common denominator for these files are the "*.pf" I need to insert "abc" any where inside these pf files. Any help will be much apreciated thanks
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: hismail
Date: September 7, 2005 at 01:48:08 Pacific
|
Reply: Hi luke Chi Thanks its works great Just 1 question, if i have to replace a field in the .pf files for example change "128" to "256" ? what do I i use. tried: for FILE in `ls *.pf` do echo sed 's/128/256/g' >> $FILE done But it just outputs to screen thanks for your help Hamim
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Unix Forum Home
Results for: Insert a line to many files
Writing specific lines to new file Summary: Hi, I have a file with 60 lines. I want to write from line 10-20 to one file, 21-40 to another new file, 41-60 to another new file. Can anybody please help me on this? ...
www.computing.net/answers/unix/writing-specific-lines-to-new-file/8034.html
Inserting header/foort to data file Summary: What is the easiest way of adding a header and a footer to a data file? I was considering sed but didn't get far. Any ideas? Thanks! ...
www.computing.net/answers/unix/inserting-headerfoort-to-data-file/6357.html
printing a line thru a loop Summary: hi, i am not doing integer aritmatic. i need to pick up a line from the file path.txt using sed command. with sed -n 1p path.txt will give me the first line from the file path.txt. so i am trying to ...
www.computing.net/answers/unix/printing-a-line-thru-a-loop/4673.html