HowFlow


HowFlow — SED command to remove blank lines, trailing and leading spaces

Share it!   Posted by lied lied 6 months ago

This command will delete all blank lines, trailing and leading spaces: (it saves the changes in a new file “cleared.txt”

#sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g' target.txt > cleared.txt



Please log in or sign up and vote for this trick if it was helpful for you.
Don't forget to subscribe to our RSS Feed RSS/Atom feed to get the latest tricks.