Removing leading spaces in a text file
I have a bunch of texts files although they all have spaces at the beginning of lines
e.g.
testing 123
download
upload
wo开发者_如何学Culd be
testing 123
download
upload
Preferably using a utility such as grep etc.
sed -i -e's/^\s*//' yourfilenamehere
You can use sed
sed 's/^ *//' file
This should work with Linux and your GNUWin Toolkit.
echo " Line starting with spaces" | sed 's/^[ \t]*//'
perl -pi -e 's/^\s+//' yourfilenamehere
精彩评论