I've got a .txt file like this:
I want to get it like this:
I'm thinking I need to replace
/(beginning of line)(new line character)/.
Please don't post pictures of text; copy and paste from the terminal into the question.
There are several ways to filter out blank lines. Two of the simplest would be as follows.
grep -v '^$' /path/to/input > /path/to/output
sed '/^$/d' /path/to/input > /path/to/output sed --in-place '/^$/d' /path/to/input # modify the file rather than creating a new one