BookmarkSubscribeSubscribe to RSS Feed

Contains with Variable Column Reference

rfeick

Community Trekker

Joined:

Sep 30, 2016

Hello,

   As part of a script I am trying to identify and then separate out data deliminated by a ^.  This script deals with production data and the ^ indicates that multiple entries were made at the same time and they show up in the same row. I want to be able to identify the rows with multiple entries by finding rows where the NC Code column contains a ^ and then separate out the multiple entries each into their own row.

   I'm running into an issue when I try to copy the data into the newly added rows. Not all the character columns contain ^ so some will just need the one value copied down into both new rows, while those with the ^ will need one of the two values copied into each added row.

  I have attached an example section of the code. I can't figure out why line 10 works, but line 20 does not. I've also tried it with just Contains(all_cols[s], "^") and c=all_cols[s]; Contains(c, "^"); but neither of those options worked either.

Thanks for your help and input!

1 ACCEPTED SOLUTION

Accepted Solutions
rfeick

Community Trekker

Joined:

Sep 30, 2016

Solution

Actually, I ended up finding a solution after I posted this. If you replace Eval Expr(all_cols[s]) in lines 20-22 with all_cols[s][i] it will work.

1 REPLY
rfeick

Community Trekker

Joined:

Sep 30, 2016

Solution

Actually, I ended up finding a solution after I posted this. If you replace Eval Expr(all_cols[s]) in lines 20-22 with all_cols[s][i] it will work.