Simple oneliner that deletes the trailing newlines of a file: {{{ sh awk '!NF{b=b "\n";next} {printf "%s%s",b,$0;b="\n"}' file }}} Explanations: * !NF : "If the line is blank (ie NF==0), then accumulate the newline in b, then skip the rest" * "If the line is not blank, print the accumulated newline, then the current line, keep the newline in b" The effect is that the newlines are only printed before non blank lines, the trailing newlines are stored in b, but never printed. If you want to keep one trailing newline, add one ;): {{{ sh awk '!NF{b=b "\n";next} {printf "%s%s",b,$0;b="\n"} END {print "\n"}' file }}}
Summary:
This change is a minor edit.
Username: