insert lines in text to get one word
perl -pi -e 's/ /\n/g' 01_Gen-words.txt
remove blank lines
to delete empty lines:
from line 633 to the end of the document:
:633,$g/^$/d
the $ represents the end of the file, the ^$ represents a blank line, and the d - delete
do delete all empty lines, globally:
:g/^$/d
and an alternate version:
:v/./d
If you want to delete blank lines or those that contain spaces or tabs, use:
:g/^\s*$/d
and an alternate version:
:v/\S/d
\S matches anything that is not a whitespace, and d deletes the flagged lines
(all lines that have only whitespace characters or are blank).
|