Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to import a CSV file that will sometimes have records and sometimes will be empty (other than the field names in the first line), however, I get a scripting error (field not found) if it does have 0 records. Any way around this issue?
Hi,
Directory;
LOAD @1 AS FIELD,
@2 AS FIELD1,
@3 AS FIEL2,
@4 AS FIELD3,
@5 AS FIELD4,
@6 AS FIELD5
FROM
[..\miRpt.csv]
(txt, utf8, no labels, delimiter is ',', msq);
can you post a sample csv and your failing load statement?
thanks
regards
Marco
In the process of attaching it --- I realized what the problem is. For some reason even though it works just fine when it creates a filewith records, when it creates a file without records the field names are space delimited, not comma delimited, so they all get strung together as the name for the first field.
Sorry about wasting people's time.