View Single Post
Old 02-29-2004, 06:47 PM  
the Grandad
Confirmed User
 
Join Date: Aug 2003
Location: the Retirement Home (Almost)
Posts: 1,038
Quote:
Originally posted by swedguy
Strip one line comments:

cat file.php | perl -pe 's/^\/\/.*$// > file2.php

file2.php will now be stripped from one line comments



Strip multi line comments:

cat file2.pp | perl -pe '$/ = ""; s/\/\*.*?\*\///sm' > file3.php

file3.php will now be without multi line comments



Strip blank lines:

cat file3.php | perl -pe 's/^\s+//' > file4.php

file4.php will now be stripped from blank lines



A quick and dirty one
erm.......... OK
Thanks anyway, hehe
__________________
The Oldest Pimp in Town
the Grandad is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote