Thread: A question for awk gurus :)
let's suppose have file this:
where "..." number of lines text. following simple command outputs between "foo" , "bar":code:... foo ... bar ...
i understand how works. if wanted skip couple of lines after "foo" well? (of course can pipeline tail -n +3 that's not interesting. ;)code:awk '/^foo/{i++;next}/^bar/{exit}i' file
i think can use getline read , throw away lines after foo. e.g.:
code:awk '/^foo/{i++;getline;getline;next}/^bar/{exit}i' file
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] A question for awk gurus :)
Ubuntu
Comments
Post a Comment