sed remove blank space beginning of line

echo " This is a test" | sed -e 's/^[ \t]*//'

If not works, maybe you file have some special not visable charters, like BOM or M-oM-?M- you can reove them to output to some temporary file and use sed or vi editor to remove them.

Leave a Reply

Your email address will not be published. Required fields are marked *