Jun 3, 2002 #1 haneo Programmer Jan 2, 2002 274 CA I want to delete one line containning "my name" for exemple, with a script. Can some one help me ! Thanks
I want to delete one line containning "my name" for exemple, with a script. Can some one help me ! Thanks
Jun 3, 2002 #2 soleblazer Technical User Nov 28, 2001 14 US There are alot of ways to do it, shell or perl would be your main bets. Using a quick grep on the sh: cat file.txt | grep -v 'my name' > file.txt Sed has a delete operator as well, so does awk Upvote 0 Downvote
There are alot of ways to do it, shell or perl would be your main bets. Using a quick grep on the sh: cat file.txt | grep -v 'my name' > file.txt Sed has a delete operator as well, so does awk
Jun 3, 2002 #3 olded Programmer Oct 27, 1998 1,065 US Hi: Here's an awk solution. The grep method is probably more efficient: awk ' { if(index($0, "my name") next else print $0 } ' data.file > newdata.file Ed Upvote 0 Downvote
Hi: Here's an awk solution. The grep method is probably more efficient: awk ' { if(index($0, "my name") next else print $0 } ' data.file > newdata.file Ed
Jun 4, 2002 Thread starter #4 haneo Programmer Jan 2, 2002 274 CA Great thanks for all ;-) Upvote 0 Downvote