I would like to delete the space between lines in a text file using awk. How can I do this with awk?
abcd
abcd
abcd
The desired output would be
abcd
abcd
abcd
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
will print out only non-blank lines from file
data.txt. It works by only printing lines with the number of fields (NF) that are non-zero (i.e., greater than zero)Alternatively,
works by only printing out lines with length that is non-zero (i.e., greater than 0).
There are other tools, such as
sedorgrep, that can do this too, but since you specifically asked for anawksolution.