Subscribe Bookmark RSS Feed

Repeated Substitutions in Lists

My apologies if this is a trivial question. I have a list of people which is unsorted and can contain duplicates. I also have a list of all the different people who could appear in the list, and a corresponding list of their respective job types, all of which in this example are one of just two numbers, i.e. 1 or 2. I want to create a list of the respective job types of all the people in the original list.

2 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

I thought this might be a place to try out Associative Arrays but I still ended up needing to use a for loop. Here it is anyway ... maybe you will see how to take better advantage:

ms

Super User

Joined:

Jun 23, 2011

I also tried to use associative arrays with a slightly different approach that I thought would avoid loops. However, I have not yet succeeded to find the right find/replace formula to yield the list "People_ExprList" below in one step. Regex() seem to only catch the first match of a string, and to do edit all the items in "People" I need to loop. Maybe there are some tricks among the numerous Pat functions that I have yet to learn.