Heres a quick tip on removing blank lines and comments from a file using sed.

sed ‘/ *#/d; /^ *$/d’ file_with_blank_lines_and_comments.txt > new_file_without_blank_lines_and_comments.txt

Cheers!

Popularity: 4% [?]

Tagged with:

Filed under: HowToLinux

Like this post? Subscribe to my RSS feed and get loads more!