C
cosmin
I feel like banging my head against the wall. I have about 20000 records
that I export from PHPMyAdmin to CSV, to which I want to make some changes
so I can import them into another MYSQL table which has different columns.
The problem is that once I open that CSV in Excel it gets royally messed up,
due to its cursed "smart" routines.
For example, the fields which are in this format "2005-11-15" get changed to
"2005/11/15" because they are autodetected as dates and Excel knows better
than me what I want, right?
Also, when exporting from PHPMyAdmin, the data is like this
"0","Freeware","WinXP,Windows2000,Windows2003","1989",
After working with it in Excel it gets turned into this:
0,Freeware,"WinXP,Windows2000,Windows2003",1989,
As you can see, only some of the fields now have quotes, (why? It's Excel
being smart again and making the CSV inconsistent) which breaks my CSV
import script.
I'm going nuts. I've tried OpenOffice, which does the same thing, unquoting
some of the fields. Tried 602 PC Suite, it crashes when opening the original
CSV, which is about 23 MB, but whatever the cause, I can't try and see if it
works any better.
Tried a tool called DMCSV which is supposed to be a CSV editor, but it locks
up when trying to open the CSV file, because apparently it can't handle the
file's size.
So I'm really stuck. Is there anyway to get Excel to put quotes around all
the fields, so it can generate a consistent CSV.
that I export from PHPMyAdmin to CSV, to which I want to make some changes
so I can import them into another MYSQL table which has different columns.
The problem is that once I open that CSV in Excel it gets royally messed up,
due to its cursed "smart" routines.
For example, the fields which are in this format "2005-11-15" get changed to
"2005/11/15" because they are autodetected as dates and Excel knows better
than me what I want, right?
Also, when exporting from PHPMyAdmin, the data is like this
"0","Freeware","WinXP,Windows2000,Windows2003","1989",
After working with it in Excel it gets turned into this:
0,Freeware,"WinXP,Windows2000,Windows2003",1989,
As you can see, only some of the fields now have quotes, (why? It's Excel
being smart again and making the CSV inconsistent) which breaks my CSV
import script.
I'm going nuts. I've tried OpenOffice, which does the same thing, unquoting
some of the fields. Tried 602 PC Suite, it crashes when opening the original
CSV, which is about 23 MB, but whatever the cause, I can't try and see if it
works any better.
Tried a tool called DMCSV which is supposed to be a CSV editor, but it locks
up when trying to open the CSV file, because apparently it can't handle the
file's size.
So I'm really stuck. Is there anyway to get Excel to put quotes around all
the fields, so it can generate a consistent CSV.