fixed length file where last field is variable length
Posted: Mon Apr 27, 2015 10:20 am
Hi
We need to load a supplier provided file which is supposed to be fixed length but the last field, which is numeric, is not being padded by space to make it fixed length. It is variable length as shown below
aaaaBBBBBccccc9<LF>
xxxxBBBBBccccc43<LF>
We are using the following schema file to load it
// Fixed width file
record
{final_delim=end,delim=none,quote=none,charset='UTF-16LE'}
(
JunkPCode:USTRING[15];
SuppRowID:USTRING[21];
OrigTitle:USTRING[256];
OrigArtist:USTRING[256];
OrigWriter:USTRING[256];
Plays:USTRING[2];
)
Now the first record that has a single digit value is being rejected with the message
input_file,0: Field "Plays" with 'delim=end' did not consume entire input
I tried final_delim=none and final_delim=end
I was hoping it would work when final_delim=end but it didn't.
Is there anyway to make it work ?
We need to load a supplier provided file which is supposed to be fixed length but the last field, which is numeric, is not being padded by space to make it fixed length. It is variable length as shown below
aaaaBBBBBccccc9<LF>
xxxxBBBBBccccc43<LF>
We are using the following schema file to load it
// Fixed width file
record
{final_delim=end,delim=none,quote=none,charset='UTF-16LE'}
(
JunkPCode:USTRING[15];
SuppRowID:USTRING[21];
OrigTitle:USTRING[256];
OrigArtist:USTRING[256];
OrigWriter:USTRING[256];
Plays:USTRING[2];
)
Now the first record that has a single digit value is being rejected with the message
input_file,0: Field "Plays" with 'delim=end' did not consume entire input
I tried final_delim=none and final_delim=end
I was hoping it would work when final_delim=end but it didn't.
Is there anyway to make it work ?