|
|
Question : Remove unwanted lines from a text file
|
|
I've got this log that has some good data in it, but like 100 meg of bogus data. I need a Perl script to take, as input, the log file and spit out just the good lines. The bad lines are all identical except for the date and time:
10/09/2000 11:07:55 PM:244: Microsoft Cursor Engine Microsoft Cursor Engine -2147217864 Row cannot be located for updating. Some values may have been changed since it was last read. 10/09/2000 11:07:55 PM:244: Microsoft Cursor Engine Microsoft Cursor Engine -2147217864 Row cannot be located for updating. Some values may have been changed since it was last read.
Can someone write me a quick script to take as input (via stdin) and put the non-error lines out to stdout?
Thanks.
|
Answer : Remove unwanted lines from a text file
|
|
#!/usr/bin/perl
while(<>) { /Microsoft Cursor Engine Microsoft Cursor Engine/ && next; print ; }
Hope this helps. :-)
|
|
|
|