Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
CSV Import Table missing first column of data |
Tue, Nov 28 2023 5:48 AM | Permanent Link |
Adam Brett Orixa Systems | I have a weird problem.
I run a fairly simple IMPORT TABLE script: IMPORT TABLE "WebOrderPreliminary" FROM "Test-Nov27.csv" IN STORE "Imports" FORMAT DELIMITED ENCODING AUTO DELIMITER CHAR #9 QUOTE CHAR '"' DATE FORMAT 'yyyy-mm-dd' TIME FORMAT 'hh:mm:ss n' AM LITERAL 'AM' PM LITERAL 'PM' DECIMAL CHAR '.' BOOLEAN TRUE LITERAL 'True' FALSE LITERAL 'False' USE HEADERS Using the attached CSV file. The import is to a table which has column-names that duplicate the names of the header-row of the CSV file. The importation occurs perfectly, except that the FIRST COLUMN (order_id) is not imported. In the "WebOrdersPreliminary" table, the order_id is NULL. If I re-order the data in the CSV file so that the "order_date" is the first piece of data in the CSV file "order_date" then shows NULL in the table. So I am losing the first column of data whatever I do. I have done countless IMPORT TABLE processes in the past without this happening before. Can anyone give me any ideas?! Attachments: Test-Nov27.csv |
Tue, Nov 28 2023 6:19 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Adam
I generally start by suspecting the data. In the file you supplied in my hex editor it starts with hex ef bb bf () - doesn't look right Roy Lambert |
Tue, Nov 28 2023 10:08 AM | Permanent Link |
Adam Brett Orixa Systems | Dear Roy
Thanks for this, really helpful. I have never got into things like hex editors. I probably need to. The output is coming from a web-service I don't have much control over. I guess I may have to try to parse the file in Delphi ... |
Wed, Nov 29 2023 2:47 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Adam
Just bunging the three characters into DDG I get this link https://en.wikipedia.org/wiki/Byte_order_mark it may be possible for you to tell the producing program to not include it. If not you should only have to bother about the first three characters so easy enough to strip. It may even be as simple as changing teh ENCODING to force unicode. Roy Lambert |
Wed, Nov 29 2023 2:49 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Adam
If you really want to do it all in Delphi its not to difficult - you could use my nlhStrTable to give you a starter for 10 - should be in the binaries. Roy Lambert |
This web page was last updated on Wednesday, August 14, 2024 at 02:26 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |