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
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
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
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
Summary: How to use sed to extract the text I have a text file look like this: /home1/users/usr1/bill.txt /home1/users/usr2/bom.txt /tmp/cost.txt All filename extension ended with txt. I need to output the a...
Summary: I want to scan a file using sed and where a condition meets a certain requirement grab the first four characters and insert a new ling plus those four characters I grabbed. Example: file1 :418:937,969...