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.
sed remove lines from a file
Name: G Chen Date: November 12, 2005 at 04:30:48 Pacific OS: linux CPU/Ram: 2.5g
Comment:
I'd like to clean a log file up by removing several lines for example:
Name: Dr. Nick Date: November 12, 2005 at 22:57:34 Pacific
Reply:
Maybe.
You still haven't said what you want to do.
0
Response Number 2
Name: G Chen Date: November 13, 2005 at 05:02:10 Pacific
Reply:
ok. I want to use sed to delete LINE1 and LINE4. I know I can do like:
#Delete LINE1 from input. Save to output1 sed '/LINE1/d' input1 > output1
#Delete LINE4 from output1. Save to output2 sed '/LINE4/d' outputfile1 > outputfil2
In this case I only delete 2 lines but what if I want to delete 100 lines? I don't want to write delete statement and save to a temp output file 100 times. There should be a smarter way or maybe sed is not a good tool to achieve it?
gangchen
0
Response Number 3
Name: Dr. Nick Date: November 13, 2005 at 11:38:16 Pacific
Reply:
Is there any logic behind the lines you want to delete? Every third line maybe, or is it just 100 arbitrary, random lines?
Summary: was wondering if you could help me with a script to remove ALL the lines in a file that contain the word "BOUNDARY". I have the script like this so far, but It will only remove the first occurance of...
Summary: I need to get from a file only the first line and to write it into other file-only using DOS commands.Till now I have managed to get the entire content of the file using a command like: FOR /F "usebac...
Summary: Please help me writing a spinet which can delete the line from a file which does not have thrird field the file contains some like ,,, xxx yyy zzz cccc yyyy xxx yyy xxx yyy nnn nnn nnn xxx yyy nnn n...