Extract data from a list

Hi All,

I have a field named “list” with the following same data:

Test~Tester2~32233~California~Test5…~Test10

How do I extract everything, for example, from the beginning to California? The @Word and @Left doesn’t seem to accomplish this for me.

Thanks

Subject: Extract data from a list

What do you really want to do? One common problem with postings in these forums is when the original poster self-edits themselves too much, and in an apparent attempt to avoid boring us to death, ends up providing too little detail.

Do you have two dimensions of data stored in a one-D structure – in other words: Is your data a series of four-element-long subsequences? What do you want as a result? A list of all of the individual four-element strings? Just the first four, as your posting literally stated?

Stan’s response appears to be addressing that; the literal interpretation of what you asked for;

@implode(@subset(@explode(list; “~”); 4); “~”)

Subject: Extract data from a list

I would suggest you look at @Middle

Subject: RE: Extract data from a list

Thanks for the comment Brian. With the @Middle, how should I set the endstring or numberchars? Since the data in the “list” field are concatenated, with ~ as a separator, how can I specify the number of element to return from?

Thanks

Subject: RE: Extract data from a list

I’d use @Explode, @Subset and @Implode, myself…

Subject: RE: Extract data from a list

Yip. That did it.

Thanks for the help.