candice Posted September 8, 2008 Share Posted September 8, 2008 Hi all, I current have a csv file with some rows of data containing commas in between the data. I need help in finding out how to ignore the commas in the csv file, because mysql is reading the commas as a field separator. I have tried things like str_replace etc, but it doesnt seem to work. Can anyone help me? [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/123221-ignore-comma-in-csv-file-before-import-to-mysql-database/ Share on other sites More sharing options...
JonnoTheDev Posted September 8, 2008 Share Posted September 8, 2008 Change the CSV to use a pipe delimeter | instead of a comma if some of the fields are text. This will make life a lot easier. Link to comment https://forums.phpfreaks.com/topic/123221-ignore-comma-in-csv-file-before-import-to-mysql-database/#findComment-636426 Share on other sites More sharing options...
aschk Posted September 8, 2008 Share Posted September 8, 2008 Please don't duplicate posts, see the answers given previously http://www.phpfreaks.com/forums/index.php/topic,215548.0.html Link to comment https://forums.phpfreaks.com/topic/123221-ignore-comma-in-csv-file-before-import-to-mysql-database/#findComment-636436 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.