Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Respected elder
Here is my script loading TXT, I want to directly load the fourth row of data, and use delimiters to separate the columns.
Hi what I meant to say is to change "RecNo()=4" to "Recno()>=3", also to try to change the header.
At the end you need:
LOAD
"TO Number",
Material,
"Material Description",
"Source Stor.Bin",
SrceTgtQty,
"Stor. bin",
S,
S as S2,
Typ,
"Dest. Bin",
"Mvmt Type",
"Mvmt Typ",
User,
"Created On",
Conf.t.
FROM [lib://Escritorio/LT22.txt]
(txt, codepage is 28591, embedded labels, delimiter is '|', msq, header is 3 lines)
where ReCno()>=2;
So, 3 lines of header, the RecNo() >=2 to skipt the line with all dash.
And set the names of the fields because the file starts with an '|' that will create an empty blank field. And there are two columns called 'S' wich causes an error because there can't be repeated names for columns, so you need to rename one (in this case I renamed the 2nd to S2).
Hi, you can change the delimiter to '|', it wouldbe in the 3rd drop down of the top.
You can also change in script, there you can also set the condition to only load the 4th row:
(txt, codepage is 28591, embedded labels, delimiter is '|', msq)
Where RecNo()=4;
By the screenshot I think you also need to change the headers rwos to 1 instead of 0.
Dear rubenmarin
Thank you for reply
I want to load the fields from the third line, not just the third line. Because I'm going to use the third line as the fields,The third row field is then split into columns.
Hi, just change RecNo()=4 to Recno()>=3.
Or add more header lines if 3rd line is the field names.
I have tried it and it is wrong. I have uploaded the attachment
Hi what I meant to say is to change "RecNo()=4" to "Recno()>=3", also to try to change the header.
At the end you need:
LOAD
"TO Number",
Material,
"Material Description",
"Source Stor.Bin",
SrceTgtQty,
"Stor. bin",
S,
S as S2,
Typ,
"Dest. Bin",
"Mvmt Type",
"Mvmt Typ",
User,
"Created On",
Conf.t.
FROM [lib://Escritorio/LT22.txt]
(txt, codepage is 28591, embedded labels, delimiter is '|', msq, header is 3 lines)
where ReCno()>=2;
So, 3 lines of header, the RecNo() >=2 to skipt the line with all dash.
And set the names of the fields because the file starts with an '|' that will create an empty blank field. And there are two columns called 'S' wich causes an error because there can't be repeated names for columns, so you need to rename one (in this case I renamed the 2nd to S2).
Very detailed reply. The problem has been solved. Thank you very much.