Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pduplessis
Partner - Contributor III
Partner - Contributor III

Possible bug with csv file load

I load a file from a 3rd party, that has several columns, all named except 3. The 3 come through as a full stop. For example:

field1, field2,.,field3,.,field4

I thought this would be ok, because of the positional nature of the bad fields. ie:

LOAD

field1 as FieldOne,

field2 as FieldTwo,

[.] as Field_Fstop1,

field3 as FieldThree,

[.] as Field_Fstop2,

field4 as FieldFour

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',');



However, I am finding the data messed up between these fields, especially if some of them come through blank.

Is this a bug, should I expect QV to handle these fields in the file based on their position? How do I work around it?

any ideas?

Philip

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello Phillip,

I haven't tested but you may try loading fields as

LOAD @1 as FieldOne, @2 as FieldTwo, @3 as Field_Fstop1, //rest of script here


so you don't have to specify the name of the field and fields are taken between the delimiter character you have specified.

Hope that helps.

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hello Phillip,

I haven't tested but you may try loading fields as

LOAD @1 as FieldOne, @2 as FieldTwo, @3 as Field_Fstop1, //rest of script here


so you don't have to specify the name of the field and fields are taken between the delimiter character you have specified.

Hope that helps.

pduplessis
Partner - Contributor III
Partner - Contributor III
Author

Thanks Miguel

Thats what I have decided to do. Its a pain, becuase I have 156 fields to do, and there are some complex transformations in there too, but its the right way to do it. Thanks

Phillip