I have a question regarding importing data from EXCEL. There is an example file ('get_data_from_excel') on the Brilliant Database website - I have attached a screenshot of the scripting of that example to supplement my question.
In the example, the number of loops is 'hard-coded' into the program (on line 5 'For [$i] = 1 to 6 Step 1'). Is there any way to have the program automatically determine when it has captured all the data from the EXCEL spreadsheet? The user could input the ending value but that is not desirable either as I want this to be an automatic feature. I then experimented with using a variable to define the ending variable. Any number greater than the actual number of rows in the data-containing EXCEL spreadsheet would work and once the program encountered blanks in all the columns for that respective row, I added a 'Break' command to have the program stop executing the script. It seems to work fine but I think that the 'Break' command is being misused in that case. Additionally, I do not like the fact that the user has to supply an ending value nor do I like programming in an artificially high number (for example, 1,000,000) so that the program appears to work right - that is just sloppy programming in my eyes.
Next, I attempted to have the program change the ending variable once blanks were encountered, but after repeated attempts, I made the discovery that once a 'For' loop was started in Brilliant Database that it was going to complete the original amount of loops that were specified at the beginning regardless of any changes to the variable after the first 'For' was encountered. The 'Break' command was the only way to have the program cease looping but I am still not convinced that the 'Break' command is being utilized properly; instead, it is my opinion that it is to be used for testing and debugging and not as part of the finished scripting... but I do not wish to debate the usage of the 'Break' command.
So, after my rather long-winded explanation, I am looking for a method that can be utilized when importing EXCEL files that can dynamically adjust to the size (number of rows)of the EXCEL file. Can someone help me with this?
Thanks,
Daryl G
In the example, the number of loops is 'hard-coded' into the program (on line 5 'For [$i] = 1 to 6 Step 1'). Is there any way to have the program automatically determine when it has captured all the data from the EXCEL spreadsheet? The user could input the ending value but that is not desirable either as I want this to be an automatic feature. I then experimented with using a variable to define the ending variable. Any number greater than the actual number of rows in the data-containing EXCEL spreadsheet would work and once the program encountered blanks in all the columns for that respective row, I added a 'Break' command to have the program stop executing the script. It seems to work fine but I think that the 'Break' command is being misused in that case. Additionally, I do not like the fact that the user has to supply an ending value nor do I like programming in an artificially high number (for example, 1,000,000) so that the program appears to work right - that is just sloppy programming in my eyes.
Next, I attempted to have the program change the ending variable once blanks were encountered, but after repeated attempts, I made the discovery that once a 'For' loop was started in Brilliant Database that it was going to complete the original amount of loops that were specified at the beginning regardless of any changes to the variable after the first 'For' was encountered. The 'Break' command was the only way to have the program cease looping but I am still not convinced that the 'Break' command is being utilized properly; instead, it is my opinion that it is to be used for testing and debugging and not as part of the finished scripting... but I do not wish to debate the usage of the 'Break' command.
So, after my rather long-winded explanation, I am looking for a method that can be utilized when importing EXCEL files that can dynamically adjust to the size (number of rows)of the EXCEL file. Can someone help me with this?
Thanks,
Daryl G