Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I wuold your opinion about my strategy.
This is the situation: I've an excel with one sheet and inside this there are multiple tables.
Each table is separated from the next one by two empty rows.
I want load the table from the beggining of the sheet and every time that I found an empty row I want increment a variable by 1.
Furthermore I want add where condition at the end of load script: when variable's value is >= 2 I'll stop the load script.
What do you think about this strategy?
How can I force the exit from load script?
Thanks.
This couldn't be done with single-load else you will need a multi-step approach.
This could be for example to load the whole sheet with all the tables into a single table, identifying each sub-table (header and data separate) with various check-statements and then splitting the tables again with the help of these identifying-data whereby you need an additional step to extract the table-header and creating a mapping table for an appropriate rename-statement.
Another approach would be to use the FIRST statement in combination of the (... HEADER is n lines ...) from the file-format. But with this method you must also know when a table begins and end - this meant you need before a load which identified them by using recno(), rowno() and various check-statements maybe in combination with interrecord-functions like peek() or previous(). With this kind of data you creates a for loop which picked the first/header information into variables which is then used within the load-statements.
The second approach here is in my opinion the easier one and with a quick look in the help to the mentioned statements and functions you could start and I think with a few trials you will understand the above described logic and after them it's just a matter of adjusting the identifying routines.
- Marcus
Hi Andrea,
How can I force the exit from load script?
Use Exit Script function in script level.
Thanks ,
Arvind Patil
This couldn't be done with single-load else you will need a multi-step approach.
This could be for example to load the whole sheet with all the tables into a single table, identifying each sub-table (header and data separate) with various check-statements and then splitting the tables again with the help of these identifying-data whereby you need an additional step to extract the table-header and creating a mapping table for an appropriate rename-statement.
Another approach would be to use the FIRST statement in combination of the (... HEADER is n lines ...) from the file-format. But with this method you must also know when a table begins and end - this meant you need before a load which identified them by using recno(), rowno() and various check-statements maybe in combination with interrecord-functions like peek() or previous(). With this kind of data you creates a for loop which picked the first/header information into variables which is then used within the load-statements.
The second approach here is in my opinion the easier one and with a quick look in the help to the mentioned statements and functions you could start and I think with a few trials you will understand the above described logic and after them it's just a matter of adjusting the identifying routines.
- Marcus