![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to search and replace text in same file | Vrgurav | Shell Programming and Scripting | 1 | 04-25-2008 03:20 AM |
| search and replace in a file | satyam_sat | Shell Programming and Scripting | 2 | 04-10-2008 10:28 PM |
| automating file search and replace text | ommatidia | Shell Programming and Scripting | 3 | 02-28-2008 01:40 PM |
| Search and replace in file.. | Amits | Shell Programming and Scripting | 2 | 08-22-2006 04:11 PM |
| Search and replace in file | malaymaru | UNIX for Dummies Questions & Answers | 3 | 05-03-2005 03:57 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Greetings....
I'm looking for the command and syntax to search files, several actually, that will find the string pattern "\0;" and delete it. I have over 200 files to change Thanx |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Check out the "grep" command which lets you search files and find strings. When you say "delete it" are you talking about the deleting the record, the file, or the "\0;" string in each record?
|
|
#3
|
|||
|
|||
|
Try this code
Have two files first.sh, second.sed as below.
first.sh ----------------------------- #!/bin/ksh for i in *.txt { echo $i /usr/bin/sed -f second.sed <$i> temp1 mv -f temp1 $i } ----------------------------- second.sed ----------------------------- s/\\0;// ----------------------------- replace *.txt with files you want to pick in first.sh then execute first.sh |
|||
| Google The UNIX and Linux Forums |