For one of my problems for class, I have a file where I am to delete duplicate blank lines in a file. so for example, I have an input file that looks like this:
Sample Line 1
Sample line 2
Sample line 3
and the output would then turn all multiple blank lines into a singular one, so the output file would look like this:
Sample Line 1
Sample line 2
Sample line 3
I've been able to complete this with a sed command, but the problem insists that I use awk in order to obtain this output.
The closest I've gotten has been with awk '!x[$0]++', but that simply deletes pretty much every blank line. I feel like I'm missing something basic.
Thanks for any help!