I would like to remove empty lines from beginthe beginning and the end of file, but not remove empty lines between non-empty lines in the middle. I think sed or awk would be the solution.
Source:
1:
2:
3:line1
4:
5:line2
6:
7:
8:
Output:
1:line1
2:
3:line2