Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][no subject]
- Date: Wed, 07 Aug 2002 08:27:05 GMT
- From: "big0" <big0@example.com>
>I have a file that contains lines like this: >1 some >text with >C/R's >in annoying places >2 more text >with CRs >3 text text text >4 text text >I'd like to concat the lines that don't have leading numbers in to one long line Use gawk or mawk, because awk have some limitations: ------------->8----------------- gawk -F" " 'BEGIN { numexp = "[[:digit:]]+"; tmp="" } NR > 0 { if ($1 ~ numexp && tmp != "") { print tmp; tmp="" } } { tmp = tmp" "$0; }' ------------->8----------------- -- ISBN: 0060256575 OpenPGP: 0xBE40FF3E
- Follow-Ups:
- [tlug] line filtering (was Re: Unidentified subject!)
- From: Shimpei Yamashita
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] cannna+kinput2
- Next by Date: Re: [tlug] Parallel port driving me nuts
- Previous by thread: Re: [tlug] cannna+kinput2
- Next by thread: [tlug] line filtering (was Re: Unidentified subject!)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links