|
Posted by Anthony Smith on 10/31/06 20:29
Greetings,
I have the need to take a file and remove the trailing white space as
well as any empty lines... I inherited this script:
cat $1 | awk -v quote="'" \
'
/^[ ]*$/ { next; }
/^.*[ ]*$/ {
printf ("%s\n",substr ($0,1,match($0, "[
]*$")-1));
next;
}
{ print $0; }
'
I prefer to do it in PHP. Is there a simpler way?
Navigation:
[Reply to this message]
|