Hi,
I would like to know how to solve one of my problems using expert unix commands.
I have a file with occasional blank lines;
for example;
dertu
frthu
fghtu
frtty
frtgy
frgtui
frgtu
ghrye
frhutp
frjuf
I need to edit the file so that the file looks like this;
1
dertu
frthu
fghtu
2
frtty
frtgy
frgtui
3
frgtu
ghrye
frhutp
frjuf
************
That is: I want to grep or find the blank line and sequentially number the blank lines and print that number in the blank space.
First of all, as mentioned in the "Edit" part of my last posting, my solution does not provide a proper answer to the original question - the requirement was to number sequentially (1,2,3...) the blank lines.
The mentioned sed command matches blank lines and replaces them with the current line number. Hence, the the following