[buug] parsing a file

johnd john at jjdev.com
Fri Dec 21 14:38:14 PST 2001


Any suggestions?

I have a transaction file...plain text. 

the first two lines I want excluded from the parsing (they are not
transactions)

I need to know about each line where the 6th field is '0' and the delimiter
is ':'


the first two lines don't have any delimiter characters, so if it would simplify
things just to say parse lines that are delimitted, that would be ok. (cut
has a flag for that)

I came up with:

 cat trans | cut -d : -f 7 -s


I'm thinking there's away to do it with some combo of standard commandline
tools...else I'll just make a little script.

the file looks like:



6685.23
1005
1000:john d:12/21/01:40.23:mem:cat:0
1004:bill d:12/21/01:45.00::bills:1
2000:sadie:12/21/01:23.00:dog food:pet:0




More information about the buug mailing list