johnsmith153 Posted August 1, 2011 Share Posted August 1, 2011 I am simply importing a CSV file to MySQL. Somebody has given me a CSV file and imagine fields are Name and Age it is like this: jim-brown,32 dave-smith, 25 bob-roberts,19 ...surely it would be easier to do "Jim Brown", 32 "Dave Smith", 25 "Bob Roberts", 19 ..or am I missing something, would these be capitalised and the dash removed on import?? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/243497-simple-csv-import-to-mysql/ Share on other sites More sharing options...
WebStyles Posted August 1, 2011 Share Posted August 1, 2011 CSV files are comma seperated, so you can have spaces too: Jim Brown,32 Dave Dmith,25 Bob Roberts,19 would be perfectly valid Quote Link to comment https://forums.phpfreaks.com/topic/243497-simple-csv-import-to-mysql/#findComment-1250286 Share on other sites More sharing options...
johnsmith153 Posted August 1, 2011 Author Share Posted August 1, 2011 So what with the jim-brown thing? Quote Link to comment https://forums.phpfreaks.com/topic/243497-simple-csv-import-to-mysql/#findComment-1250287 Share on other sites More sharing options...
TOA Posted August 1, 2011 Share Posted August 1, 2011 The dash may or may not be needed depending on your setup. If you need to store first name in one field and last in another, the dash is needed to parse out the pieces, otherwise if you are storing them in one field, it would not. Quote Link to comment https://forums.phpfreaks.com/topic/243497-simple-csv-import-to-mysql/#findComment-1250289 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.