Thanks but I've that already try that

C:\temp>perl -pi.bak -e "s/\s+/,/g" tempfile.out

C:\temp>more < tempfile.out
Server,Drive,FSTYPE,Size,Free,Used,SERVER1,C$,NTFS,4095,296,3799,SERVER1,D$,NTFS,4001,1908,2093,SERVER1,C$,NTFS,38123,29808,8315,

The only thing that is missing is that after field 6 there is no comma,
but a newline

So that it will come out like this

Server,Drive,FSTYPE,Size,Free,Used
SERVER1,C$,NTFS,4095,296,3799
SERVER2,D$,NTFS,4001,1908,2093
SERVER3,C$,NTFS,38123,29812,8315



> On Mar 12, 2004, at 2:55 PM, Distribution Lists wrote:
>
>> Can someone please tell what regular expression would change
>>
>> Server   Drive   FSTYPE       Size      Free      Used
>> SERVER1  C$       NTFS        4095       296      3799
>> SERVER2  D$       NTFS        4001      1908      2093
>> SERVER3  C$       NTFS       38123     29811      8312
>>
>> to
>>
>> Server,Drive,FSTYPE,Size,Free,Used
>> SERVER1,C$,NTFS,4095,296,3799
>> SERVER2,D$,NTFS,4001,1908,2093
>> SERVER3,C$,NTFS,38123,29812,8312
>
> s/\s+/,/g;
>
> James
>
>


-- 




-- 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to