sed tip : removing blank space from the front of a line

There are times when you want to trim text quickly, maybe in a shell script. One way to do this is to use sed. To trim off all blank spaces, including any tab characters, just use


sed -e "s/^[ \t]*//g" your_text.txt

This will go through your file and trim the front of each line.

No comments:

Post a Comment