Distribution Lists wrote: > >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 > Ok, so use a character class:
s/[ \t]+/,/g; (mind the space in front of the tab inside the character class) HTH, Jan -- Hanlon's Razor: Never attribute to malice that which can be adequately explained by stupidity. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>