Computing.Net > Forums > Unix > useing sed

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

useing sed

Reply to Message Icon

Name: gpatel
Date: July 21, 2005 at 13:09:11 Pacific
OS: unix
CPU/Ram: 256
Comment:

hello,
I have 200 files. lets say start w/
file1,file2...file200
now under file1 this is how my data looks like

0012 0023; 45 56
0023 0045; 65 25
0021 0042; 24 12
Time = 2:43

now what i wanted to do is remove all the ";" and the whole line with "Time = 2:43"
cand someone please help me w/ this. possibly a script.
thanks a lot.
gpatel



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: July 21, 2005 at 21:45:45 Pacific
Reply:

If the Time string is the last line in the file, this works:

sed -e 's/;//g' -e '$d' file.*


0

Response Number 2
Name: gpatel
Date: July 22, 2005 at 06:31:40 Pacific
Reply:

thanks, i did try that adn it does works. now would you know about the my second question. like i wanted to delete a file which contain some kind of string. lets say file1.txt has a string called "Error". I wanted to delete or move all those file which has Error.
Thanks a lot for your help


0

Response Number 3
Name: Luke Chi
Date: July 22, 2005 at 11:20:01 Pacific
Reply:

rm `grep -l Error *`

Luke Chi


0

Response Number 4
Name: gpatel
Date: July 22, 2005 at 18:16:54 Pacific
Reply:

thanks luke & nails


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: useing sed

using sed www.computing.net/answers/unix/using-sed/4164.html

Extract text using sed www.computing.net/answers/unix/extract-text-using-sed/5169.html

Loop using SED www.computing.net/answers/unix/loop-using-sed/7471.html