I\'ve used a grep command with sed and cut filters that basically turns my output to something similar to this
this line 1
this line 2
another li
Add this filter to remove whitespace from the beginning of the line and remove blank lines, notice that it uses two sed
commands, one to remove leading whitespace and another to delete lines with no content
| sed -e 's/^\s*//' -e '/^$/d'
There is an example in the Wikipedia article for sed which uses the d command to delete lines that are either blank or only contain spaces, my solution uses the escape sequence \s
to match any whitespace character (space, tab, and so on), here is the Wikipedia example:
sed -e '/^ *$/d' inputFileName