On 30/06/06, paul at clubi.ie <paul at clubi.ie> wrote:
> On Thu, 29 Jun 2006, Ray Kelly wrote:
>> > The basic way that this is now formatted is
> > Date {cr}
> > {tab} RX {tab} rx_figure {cr}
> > {tab} TX {tab} tx_figure {cr}
> > {tab} RXB {tab} RXB_figure {tab} (blah){tab} TXB {tab} TXB_figure {tab}
> > (blah) {cr}
> >
> > what I'm trying to do now is to pull all of of this onto one line
> > so that a carrige return followed by a tab should get replaced by a
> > tab,
>> Put following in a file:
>> $1 ~ /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/ {
> if (line) {
> print line;
> line = "";
> }
> }
>> { line = $0 "\t"; }
It's better to trigger on end-of-record than start-of-record, as that
avoids off-by-one hassles.
It makes the whole thing simpler too:
awk '{o=o $0}; /\)$/ {print o;o=""}'
f
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!