Martin Jørgensen wrote:
> Hi,
>
> I have a +200 kb log file from which I want to remove lines such as this
> one:
>
> 5950K ......... ......... ......... ......... ......... ......... 59%
> 5600K ......... ......... ......... ......... ......... ......... 60%
> 5650K ......... ......... ......... ......... ......... ......... 61%
>
> It's called wget-log. I'm not really good at linux bash shells so how do
> I remove those lines with "......... ......... ......... ........." ?
>
> I suppose I could do something like "cat wget-log |
> (some-command/grep?) > newfile" but there are probably better methods,
> including not creating a new file...
>
>
> Best regards
> Martin Jørgensen
>
> --
> ---------------------------------------------------------------------------
> Home of Martin Jørgensen - http://www.martinjoergensen.dk
if you know Python,
o = open("newfile","a")
for lines in open("wget-log"):
if not "......... ......... ......... ........." in lines:
o.write(lines)
o.close()