Remove blank lines from a file using grep
grep -v "^$" filename > newfilename
The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.
grep -v "^$" filename > newfilename
The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.
Add New Comment
Viewing 6 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment