I have a question on something similar, wonder if anyone can help? Am doing the following: 1. Capturing an address from an HTML TEXTAREA form element, with wrap=physical and multiple lines. 2. Am placing this into a MySQL database. 3. Am then running a report that dumps the database entries to a tab deliminated or CSV file format to my web browser, for download and import into a spreadsheet. The problem I have is that the address ends up containing carridge returns and line feed characters, so that when I extract the data and import it, the spreadsheet treats these as record separators and breaks the format. The only way around I have at the moment is to use the following bit of Perl: $text =~s/\r\n/, /gm; Which replaces the CRLF sequence (\r\n in Perl) with a comma and a space. Not great but works. I also strip out tab characters: $text =~s/\t//gm; Anyone got any better ideas? Thanks, Mike. -- Mike Harris Open Systems and Internet Consultant Psand Espa�a, C/ de l'Encarnaci� 35 2� 2� 08012 Barcelona, Spain Tel: +34 93 213 6872 / +34 69 676 3122 Website: www.psand.net
--- F R E N D Z of martian --- > $text =~s/\'/\\\'/gm; ? I'll get my coat... Brownie (hmlt specialist) -----Original Message----- From: Martin Cosgrave [mailto:[EMAIL PROTECTED]] Sent: Friday, June 09, 2000 11:24 AM To: multiple recipients of Subject: Re: Irish Names and Forms. --- F R E N D Z of martian --- > $text =~s/\'/\\\'/gm; I would normally have it $text =~ s/\'/\\'/g; (dunno quite what m does in yours - the camel book says 'treat as multiple lines' but not sure what that means! g normally works for me) Looks like you're storing the literal string \' into the database, whereas with mine it stays as ' once it has got through the SQL parser. Am I missing something...? martian (usual apols to non-techies) -- Sent to you via the frendz list at marsbard.com The archive is at http://www.mail-archive.com/[email protected]/ -- Sent to you via the frendz list at marsbard.com The archive is at http://www.mail-archive.com/[email protected]/
