The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed remove last 10 characters of a line start from 3rd line minifish Shell Programming and Scripting 7 03-26-2008 01:42 PM
SED help (remove line::parse again::add line) Malumake Shell Programming and Scripting 6 10-24-2007 02:02 PM
Remove header(first line) and trailer(last line) in ANY given file madhunk Shell Programming and Scripting 2 03-13-2006 12:36 PM
Remove first 15 line bobo UNIX for Dummies Questions & Answers 6 01-30-2006 06:26 PM
find, remove, and ftp...... peter.herlihy UNIX for Dummies Questions & Answers 1 06-25-2002 03:51 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-14-2008
lulle
Guest
 

Posts: n/a
go throuugh, find and remove line

I have a file which I want to go through with a list of strings. When a string in the file is found, the whole row, where the string was found, sholud be removed. Then, the file should be serched for the next string in the list...

I did like this:

while read ORDERBOOKS; do

grep -iv $ORDERBOOKS file.txt > ProteusNew.xml

done < orderBooks.txt

but then, it only solves the problem fore the last string in ORDERBOOKS, which is a list of with collum.

Anyone??
Please!
Reply With Quote
Forum Sponsor
  #2  
Old 02-14-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
The file that has small strings to be matched we can call a patternfile, the big file, datafile.
Start with this:

Code:
grep -v -f patternfile datafile > new_datafile
Reply With Quote
  #3  
Old 02-15-2008
lulle
Guest
 

Posts: n/a
Thanks, that works brilliant.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:02 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