The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-27-2001
Registered User
 

Join Date: Feb 2001
Location: Orlando, FL
Posts: 2
Question search and replace in ASCII file

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  
Old 07-27-2001
Registered User
 

Join Date: Jul 2001
Location: New York
Posts: 11
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  
Old 07-27-2001
Registered User
 

Join Date: Jul 2001
Posts: 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
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0