in reply to Re: Way to remove the new line characters at the end of the content in a file
in thread Way to remove the new line characters at the end of the content in a file
Lines containing e.g. a lone } will be removed with that. I'd do this:
perl -ni.bak -le "print if $_" my_file.txt
update: Oops! choroba is right below. Heck...
perl -ni.bak -le "print if length $_" my_file.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Way to remove the new line characters at the end of the content in a file
by choroba (Cardinal) on Jul 22, 2015 at 10:16 UTC | |
|
Re^3: Way to remove the new line characters at the end of the content in a file
by Laurent_R (Canon) on Jul 22, 2015 at 11:25 UTC |