Hello,
I hava a file resulting from a script which ends as follows:
172|18|FOOTER|DISCLOSURE||16�
173|0|FOOTER|FILE||18�
note the paragraph signs are only placed to demonstrate the problem
I want it to return the same last lines but without the last empty paragraph i.e:
172|18|FOOTER|DISCLOSURE||16�
173|0|FOOTER|FILE||18
What i need is no empty line at the end of the file
I tried all the following but they either did nothing or deleted the last line instead of the last empty line.
sed '/^$/N;/\n$/D'
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}'
sed '$d'
sed '/^$/d'
sed '/./!d'
any help would be much appreciated