distal-attribute
distal-attribute
distal-attribute
distal-attribute

Will import first column, but not the rest

ltayloradam posted 2 years ago in Import/Export
When I first started using this program today, HeidiSQL only imported the first column and gave several errors that the value of the first column wasn't long enough. It did order the data in the correct rows. Now it only created three rows and added random data into two of the three columns. What am I doing wrong?
jfalch posted 2 years ago
When you first started using this program today, what exactly did you DO ? Did you try to import a .csv file into an existing table, or what ? and if so, what are the characters that separate fields in the csv file ? how many fields have the liens in the .csv file, how many fields has the table ?
ltayloradam posted 2 years ago
I imported into a table that existed, but was empty. What characters do I need to separate fields? Do I add them in every cell or at the end of every column?
jfalch posted 2 years ago
what kind of file are you trying to import into heidisql ?
ltayloradam posted 2 years ago
CSV file. One spreadsheet has airport information, the other FBO.

jfalch posted 2 years ago
when you export .csv files from excel (or etc) by using "save as" with file type csv, the cell values are stored as adjacent fields in the resulting text file, one row per line. To separate these fields, excel usually uses a semicolon. cf rfc4180 for details; note that special care is necessary if any of the cell values should contain a double quote (") or semicolon character.

when using the "import csv file..." tool from heidi´s menu, the following dialog has a panel named "control characters" in the upper right. Specify here the characters actually used in your file; with excel, its usually
"fields term by" = ;
"fields encl by" = "
"fields esc by" = \
"lines term by" = \r\n
if the file should contain as first line a header line with field (=column) names, also set "ignore first" to 1 on the upper left.

does this work ? if not, please post the first two lines from your airport file.
jfalch posted 2 years ago
PS you can open the .csv file with any editor (e.g. notepad) to see its contents as heidisql sees them.
jfalch posted 2 years ago
PS2: if the order of the fields in the database table (shown in the bottom right panel "Destination") should be different from the order of the fields in your .csv file, you must also first reorder the fields in this panel, using drag&drop, so that the resulting order of fields parallels that in the file.
ltayloradam posted 2 years ago
ID ICAO FAAorIATA
101 KACK ACK
585 KAPF APF

This is a small example of the spreadsheet.

ID, ICAO, FAAorIATA
101,KACK, ACK
585,KAPF, APF

This is how heidisql sees it

What character's do I need and where should they be placed for heidisql to read this correctly?

jfalch posted 2 years ago
"fields term by" in import dialog must be set to comma (,), not semicolon, since that is what separates the three fields in your csv file.

jfalch posted 2 years ago
PS all characters have already been placed correctly in your csv fiel by excels "save as" function. you only have to tell heidisql about them via the import dialog.

Please login to leave a reply, or register at first.