For any regex gurus out there here is a problem I have and can't seem to figure it out. I have a file that is exported using windows comma delimited format, but, some digits are are not quoted. I need to use php to prepare the file for importing into mysql db, and to do so, it has to be delimited uniformly. To make matters worse there are columns with comments that have embedded commas, and digit fields with no quotes!
Here is a sample to be changed:
"fname","lname",21,32,"address 123","comments this is, hard"
It needs to be delimited thusly:
fname~lname~21~32~address 123~comments this is, hard
Many thanks for any suggestions.