awk and cat - How to ignore multiple lines?

Posted by Filipe YaBa Polido on Stack Overflow See other posts from Stack Overflow or by Filipe YaBa Polido
Published on 2011-01-10T01:31:06Z Indexed on 2011/01/10 1:53 UTC
Read the original article Hit count: 653

Filed under:
|
|
|

I need to extract Voip log from a D-Link router, so I've setup a little python script that executes a command in this router via telnet. My script does a "cat /var/log/calls.log" and returns the result, however... it also sends non-important stuff, like the BusyBox banner, etc... How can I ignore lines from 1 to 6 and the last 2 ? This is my current output:

yaba@foobar:/stuff$ python calls.py


BusyBox v1.00 (2009.04.09-11:17+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

DVA-G3170i/PT # cat /var/call.log
1         ,1294620563,2  ,+351xxx080806  ,xxx530802      ,1  ,3  ,1
DVA-G3170i/PT # exit

And I just need:

1         ,1294620563,2  ,+351xxx080806  ,xxx530802      ,1  ,3  ,1

(it can have multiple lines) So that I can save it to a CSV and later to a sql db.

Thanks, and sorry my bad english.

© Stack Overflow or respective owner

Related posts about filter

Related posts about sed