Can you iterate over a line of data?

Greetings!  I have a List variable that I am adding to at various points.  Each line of the list looks something like:

1234567,Smith,John,W,Jones,Robert,L

I can obviously use the List Iterator to get each line, but how do I iterate over the line itself to get the field values?

Do I need to write the list out to a file and then use the CSV Iterator to iterate through the file?  Or is there a more elegant solution that can do a CSV iteration over a line of data?

Thanks,

Jonathan

Hi Jonathan,

Great question!

I would use another list iterator with a custom separator of comma (,). The way to implement this is to have another list iterator action inside your line list iterator. In this second list iterator, in the “list of items” section write your line variable (say %myLine%). This will then change the internal list iterator to have the contents of the line. Change the list separator to comma will now mean it will iterator over each part within the line.

The end result should look like.

List Iterator [myLine]
     List Iterator [myLineSegment] 
         Do something with line segment

Let me know how that goes for you.

Excellent point.  I never thought of treating each line as its own list, but I bet that will work really well.  Thank you for the tip!