And if you quote all of your fields, don't forget to escape any quotes within the data. You can't get around escaping quotes, commas, tabs, etc. when your data can contain the list delimiters. If you're not stuck with using commas, try picking a "safe" delimiter such as "|" or some other character that is illegal within the data.
Matt > -----Original Message----- > From: Timothy Johnson [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 09, 2002 4:11 PM > To: 'Thomas R Wyant_III'; [EMAIL PROTECTED] > Subject: RE: progress! > > > > It might be safest to enclose your fields in double quotes > just in case. Any > CSV reader will know not to include the commas between them. > > -----Original Message----- > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 09, 2002 2:06 PM > To: [EMAIL PROTECTED] > Subject: RE: progress! > > > > Mike - > > If there are commas in your data, you might want to look into > Text::CSV. If > not, I'm with Timothy Johnson. > > Tom Wyant > > > > > Timothy Johnson <[EMAIL PROTECTED]>@listserv.ActiveState.com on > 09/09/2002 04:38:23 PM > > Sent by: [EMAIL PROTECTED] > > > To: "'Mike Singleton'" <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] > cc: > Subject: RE: progress! > > > > open(OUTFILE,">myfile.csv"); > while(<@files>){ > my @f = split /s+/,$_,9; > print OUTFILE join(',',@f)."\n"; > } > > should work. > > -----Original Message----- > From: Mike Singleton [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 09, 2002 1:33 PM > To: [EMAIL PROTECTED] > Subject: progress! > > > Using the following code, how would I write it's output to a > single csv > file?? > > === Start=== > use strict; > my @files = glob('3*.log'); > while (<@files>) { > my @f = split /\s+/, $_, 9; > print join ',', @f; > } > > __END__ > > ==== End Code ==== > > > DaVita Inc. > _______________________________________________ > Perl-Win32-Admin mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ > Perl-Win32-Admin mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > > > _______________________________________________ > Perl-Win32-Admin mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ > Perl-Win32-Admin mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs