jason corbett <[EMAIL PROTECTED]> wrote: : I want to eliminate the ". " (periord) or "," (comma) from : records that I return from a query, but I cannot figure out : how to approach it. Does Perl have a way that I can match a : string that from an array, remove a character or characters? : : : For example say I have array @records that contain the : following: : : Myrecord1 Myrecord2 Myrecord3 Myrecord4 : Myrecord5, inc. Myrecord6, LP Myrecord7, LLC : : I want to send this query out to persons in a .csv file but : the join(",", @record) statement that I am using causes the : and extra cell to be created at Myrecord5, inc. Myrecord6, LP : Myrecord7, LLC. : : What I am thinking is to scan records $record[4, 5, 6] by : using regex matching, and if a comma exists, delete it or : replace it with ";" . I am looking for some commands to do : this, or at least point me in the right direction. : : Any suggestions?
You mention an extra cell. If you are using this for import to a spreadsheet, you should be able to wrap suspect fileds with double quotes. Try this. $_ = qq("$_") foreach @record[4, 5, 6]; my $record_list = join ',', @record; HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>