Tuesday, February 24, 2015

AWK remove last Carriage Return

When you are manipulating text sometimes you may want to go back to the last line which had text:
So the next line will delete any carriage return until it reaches text:

awk "BEGIN{ORS=\"\"}{print n $0}!n{n=\"\n\"}" asd.txt

0 comments:

Post a Comment