Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
asicsp
on May 29, 2019
|
parent
|
context
|
favorite
| on:
Removing duplicate lines from files keeping the or...
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 }
RBerenguel
on May 29, 2019
|
next
[–]
I wasn't aware of this, might come handy for "one liner edge cases".
nerdponx
on May 29, 2019
|
prev
[–]
That I did not know, great tip, thank you!
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
for ex:
gives (default output file is awkprof.out)