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] Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.