![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Thanks, that works brilliant.
|
|||
| Google The UNIX and Linux Forums |