Mike Singleton wrote:
> 
> How would I remove all the space and replace them with commas, but where
> there is more than one space in a row, only replace those with one comma? In
> other words make the follwing file comma delimited and strip out everything
> preceding the date?
> 
> === My crack at the script ===
> 
> use strict;
> 
> while(<>) {
> s/\s/,/g;
> s/^.*?(\w{3} \w{3}\s+\d+.*)$/$1/; # modified slightly
> print;
> }


$ perl -le'
                                           
$text = "one  ,two   three,  four,\t five";
print $text;
                     
$text =~ tr/, \t/,/s;
print $text;
'
one  ,two   three,  four,        five
one,two,three,four,five




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to