I have a text file which has blank lines. I want them to be removed before upload it to DB using SQL *Loader. Below is the command line, i use to remove blank lines.
sed '/^ *$/d' /loc/test.txt
If i use the below command to replace the file after removing the blank lines, it replace the existing file with a blank file.
go in to insertion mode by pressing I...now to remove a row press dd....this will completely remove the row and to save the fileuse the command
:wq to quit and save the file
:w to save the file but still be inside the vi editor