2 ms·
to add to this, if you've coded one-liner first, you can convert to script using -o option for ex: awk -o '{ORS = NR%2 ? " " : RS} 1' gives (default outp
by asicsp 7y ago
to add to this, if you've coded one-liner first, you can convert to script using -o option
for ex:
awk -o '{ORS = NR%2 ? " " : RS} 1'
gives (default output file is awkprof.out)
{
ORS = (NR % 2 ? " " : RS)
}
1 {
print $0
}
- nerdponx 7y agoThat I did not know, great tip, thank you!
- RBerenguel 7y agoI wasn't aware of this, might come handy for "one liner edge cases".