• Guest, The rules for the P & N subforum have been updated to prohibit "ad hominem" or personal attacks against other posters. See the full details in the post "Politics and News Rules & Guidelines."

Intelligent Text replacement within a text file


Senior member
Jun 20, 2000
Through my own ineptitude, I've ended up with about 100 of my emails trapped in a mySQL database table. My goal is to free them by importing them back into Outlook as a .CSV file, then back onto my IMAP server. I can pull the table containing the trapped mail down to my computer as a quasi-CSV file. The problem is that my fields are 'dirty'. There are commas in fields within fields, \r\n replacing line breaks and other such nastiness that makes outlook unhappy when doing the import. First off, is there an easier way to do this than cleaning the CSV file then doing an import? Secondly, the first option failing, any advice on cleaning up this file? I can get rid of the offending commas in the fields by doing a regular expression replace using Crimson Editor, but I can't do much about the escaped line breaks within one of the fields because putting line breaks into a CSV file upsets Outlook tremendously. The other blocker I have run into is Excel will not let me do mass finds and replaces on this data, complaining that the formula is too big (many lines are longer than this as the body contains more than "please, respond". Any ideas? Thanks!

INSERT INTO mail_client VALUES (167,2,'testing 1 2 3','\r\nplease, respond\r\n','someone@somewhere.com','someone@nowhere.com','',NULL,NULL,'-',1,'s','','20031217022620',NULL,NULL,NULL,NULL);