gnucom.cc
Code snippets and more…
Skip to content
About
Favorite Books
Featured
Building your own programming language
Part 0. Preparing a build environment
Part 1. Basic Types
Open Source & Free Software
Tag Archives:
one-liner
Removing leading whitespace in file with perl.
By
sholsapp
|
Published:
June 22, 2009
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
Posted in
Programming
,
Webhosting
|
Also tagged
perl
,
regex
|
Leave a comment
Pages
About
Favorite Books
Featured
Building your own programming language
Part 0. Preparing a build environment
Part 1. Basic Types
Open Source & Free Software
Categories
Nagios
NLP
Programming
Ubuntu Linux
Webhosting
Wordpress
Archives
September 2010
(2)
August 2010
(4)
July 2010
(15)
June 2010
(7)
December 2009
(1)
September 2009
(1)
August 2009
(9)
July 2009
(17)
June 2009
(5)
January 2009
(1)
Removing leading whitespace in file with perl.