Get Size returning Incorrect number from list


I am using Get Size to return the list size of a tab delimited.txt file. It seems to be always returning 1 item less that what is in the file… for e.g.I have 24 items in a .txt file which I am loading into a list variable. Then I use Get Size to save this into a variable, but the variable returns 23… Is there something that I am missing… any help would be appreciated.



Hi @ram_symprio_co

I couldn’t reproduce this error. Could you share the text file you use (with some test data)?

Thanks for your quick response, this is one of the file’s that I tried with
123.txt (166 Bytes)

as you can see in this case I have 24 data items in the file…

… I am using read file to get the contents and store into a list variable, and then I am using Get size to store this into a variable

You can see in the attached execution log that the size returned in 23
execution-result.csv (246 Bytes)

In the file, the separator between PRICE and MANUAL-OTHER is a new line, and the separator in the action is TAB, so it counts these two values as one.

If there are different separators in the file, you could use this workaround:

  • after reading the file’s contents to a List variable, split each element in the list using the second separator

  • combine them back to a single List variable using Expression action

Here is a sample script (794 Bytes)

1 Like

great… let me try this out and update the thread … thanks

1 Like