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

Will import first column, but not the rest

User, date Message
Written by ltayloradam
2 years ago
Category: Import/Export
4 posts since Tue, 07 Aug 12
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?
Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
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 ?
Written by ltayloradam
2 years ago
4 posts since Tue, 07 Aug 12
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?
Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
what kind of file are you trying to import into heidisql ?
Written by ltayloradam
2 years ago
4 posts since Tue, 07 Aug 12
CSV file. One spreadsheet has airport information, the other FBO.
Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
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.
Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
PS you can open the .csv file with any editor (e.g. notepad) to see its contents as heidisql sees them.
Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
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.
Written by ltayloradam
2 years ago
4 posts since Tue, 07 Aug 12
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?

Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
"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.
Written by jfalchMoney, Euro
2 years ago
381 posts since Sat, 17 Oct 09
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.