cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
cchueng
Level III

Parse string of a column and fill another column

Hi, 

I have a table containing ProductName and I want to generate the OUTPUT column.  The OUTPUT column a concatenation of ProductID with Serial#. How do I accurately parse the Serial# and create the OUTPUT column?

Serial # examples:

  • 07-08_13 means Serial# 07, 08, 13
  • 09-12 means Serial# 09, 10, 11, 12
  • 01-03_05-08 means Serial# 01, 02, 03, 05, 06, 07, 08
  • 01_04_05-08 means Serial# 01, 04, 05, 06, 07, 08
  • 09_11_13_14 means Serial# 09,11,13,14

 

cchueng_5-1633542341785.png

 

ProductNameOUTPUT
AABBCC_07-08_13AABBCC-07
AABBCC_07-08_13AABBCC-08
AABBCC_07-08_13AABBCC-13
AABBCC_09-12AABBCC-09
AABBCC_09-12AABBCC-10
AABBCC_09-12AABBCC-11
AABBCC_09-12AABBCC-12
EEFFGG_02EEFFGG-02
HHIIJJ_01-07HHIIJJ-01
HHIIJJ_01-07HHIIJJ-02
HHIIJJ_01-07HHIIJJ-03
HHIIJJ_01-07HHIIJJ-04
HHIIJJ_01-07HHIIJJ-05
HHIIJJ_01-07HHIIJJ-06
HHIIJJ_01-07HHIIJJ-07
KKLLLMM_01-03_05-08KKLLLMM-01
KKLLLMM_01-03_05-08KKLLLMM-02
KKLLLMM_01-03_05-08KKLLLMM-03
KKLLLMM_01-03_05-08KKLLLMM-05
KKLLLMM_01-03_05-08KKLLLMM-06
KKLLLMM_01-03_05-08KKLLLMM-07
KKLLLMM_01-03_05-08KKLLLMM-08
NNOOPP_01_04_05-08NNOOPP-01
NNOOPP_01_04_05-08NNOOPP-04
NNOOPP_01_04_05-08NNOOPP-05
NNOOPP_01_04_05-08NNOOPP-06
NNOOPP_01_04_05-08NNOOPP-07
NNOOPP_01_04_05-08NNOOPP-08
QQRRSS_09_11_13_14QQRRSS_09
QQRRSS_09_11_13_14QQRRSS_11
QQRRSS_09_11_13_14QQRRSS_13
QQRRSS_09_11_13_14QQRRSS_14

 

 

 

 

 

 

20 REPLIES 20
txnelson
Super User

Re: Parse string of a column and fill another column

Yes you can, but you will have to work the logic out as to when to add new rows, etc.  What I suggest, is that what you do, is run the code as is, and then use

     Tables=>Join

to put the 2 data tables together.

Jim