![]() |
MySQL imports csv file and appends quote marks - how to remove?
Hello,
I'm importing a csv file into a MySQL table, and it works perfectly, except for the csv file added quote marks on two of the columns when I created it. So the question is; - What's the best way to remove the quote marks out of the file? or - Is there a way to ignore those marks when the file is imported into MySQL? Any help would be greatly appreciated. |
Could you post the following:
Sample data of the csv, the fields which are having issues, and an example of how they look in mysql when you select the data? |
Thanks, I think I figured something out
Thanks for offering help! I think I may have figured something out. I opened the original file and used 'sed' to remove the quotes, substituting the quotes with nothing. I had to run sed 4 times since it would erase the first quote per line, then go on to the next line (I don't know how to use sed very well yet). But this worked, and my file looks perfect.
Thanks for a timely reply! |
You can use 's/string/replace/g' to get all of them on the line instead of just the first.
|
Thanks for what you sed
Quote:
|
I've found when using sed the sed-one liners page is excellent for figuring out the particulars of how a features works. Once you understand how some of the one liners work you can move on to learning sed in a more methodical manner and it's considerably easier.
Check it out: Sed One-liners |
Thanks for the tip
Quote:
BTW, I checked out your company's main page. Looks like a really great company. Do you find customers leery about switching to Ubuntu or other FOSS platforms or software? |
| All times are GMT -5. The time now is 12:19 AM. |