Multiple lists and For Each Item in a Collection

I have a need to work with two lists of equal entires. I set two variables with the lists:

Variable: vOriginals
Item 1
Item 2
Item 3

Variable: vReplacements
Replacement for Item 1
Replacement for Item 2
Replacement for Item 3

I have a calculation that counts the line items and stops the macro if they don’t have the same amount of lines. What I want to do is run a process that contains many macro steps for each item. I thought of using the For Each Item in a Collection step which would run a loop the proper amount of times but I don’t know how to use the proper line from the second variable. Meaning, when it runs the first time it should use ‘Item 1’ and ‘Replacement for Item 1’. When it gets the next line, ‘Item 2’ it should use ‘Replacement for Item 2’ from variable vReplacements.

Because the lines in the variables can contain multiple words, I can’t really make one list and extract left and right words.

Any thoughts on how this can be done?

The second example in Iterating Through Entries in a String shows how to get the Nth entry from a string, so one possibility would simply be to use For Each Variable N in Number Collection 1..Count and get the Nth entry from each string.

Another would be to "pluck off" the first entry of each string until the strings are empty, something like this (it only shows the replacements, but you can pluck off the string from both lists in each loop.).

Thanks Peter!

I used the second example in Iterating Through Entries in a String. I recall seeing that some time ago but never put 2 and 2 together until now.


. . . Stephen