Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got a web file that I need to load certain tables from. So the first thing I need to do is load Row 1 of Field @1 from ALL tables. I've written a little Loop script. In the attached example is 24 tables but in some files I'll have more or less tables so I want to set this as a variable for the last table number. Any ideas?
For vTableNo = 1 to 24
TABLES:
LOAD @1 as TableType,
$(vTableNo) as TableNo
FROM
TandE_Reviewer_029229G_25_05_2018.html
(html, codepage is 1252, no labels, table is @$(vTableNo))
Where RecNo()=1
;
Next vTableNo
Hi Shane,
Have a look at the attached file. I believe this should work ( XML loading have all the table details and I am using one of the field to get the table count) for all the files. Just to make sure kindly test all your files and let me know if you face any issues.
Hi Shane,
Have a look at the attached file. I believe this should work ( XML loading have all the table details and I am using one of the field to get the table count) for all the files. Just to make sure kindly test all your files and let me know if you face any issues.
Thanks. I've only got one web file myself to test with so will have to check when I get more. My other alternative is to use error trapping i.e.
//load row 1, field 1 of all possible tables
ErrorMode=0
For vTableNo = 1 to 100000
TABLES:
LOAD @1 as TableType,
$(vTableNo) as TableNo
FROM
TandE_Reviewer_029229G_25_05_2018.html
(html, codepage is 1252, no labels, table is @$(vTableNo))
Where RecNo()=1
;
//If table not found exit loop
If ScriptError=10 then
Exit For
End If
Next vTableNo
ErrorMode=1
That is also good option . But I don;t think you will have 1 lakh tables in single html file .
Haan yaar, I decided to go high rather than too low.
Shane -Agree, I was simply saying . Do you speak Hindi?
Only a few phrases I picked up from colleagues.