Removing leading whitespace in file with perl.

Do you ever have code with such poor formatting that you just need to start over? This will let you remove all leading whitespace from every line in the file. I’ve found it handy every now and then.

perl -i -pe's/^\s+//' file.c

This entry was posted in Programming, Webhosting and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.