How to insert into a table variable from a non Excel source file?

Hi

Following up from my previous question https://forum-2-new.workfusion.com/t/get-size-returning-incorrect-number-from-list/57077

Now that we have successfully split the file, my next query is on how can I insert a part of this data into a table variable…
In this case (sample data file 123.txt (448 Bytes)) I need to insert data from list item index 22 into a table that has 5 columns… so it would be list item index 22-26 would be row 1 in a table variable, 27-31 row2 and so on, till I reach the count of records in this file which is 66…

Any help on this would be appreciated…

One option that I can think of is to convert this text to an excel upfront and then get range into a table variable… any other option?

Thanks in advance

If you know that the elements that you need to write to the table always start with element 22, you can use this custom action to get a sub-list from the list your elements, and then write to a table using Expression action.

Here is a sample recording.
split-list_and_write_to_table.zip (1.3 KB)

@CustomScriptAction(
    input = ['final_records', 'row_start', 'row_end'],
    output = 'sublist'
)
 
def customScript() {

sublist = final_records[row_start..row_end]

}

1 Like

Thanks… let me try this

1 Like