Topic
  • 2 replies
  • Latest Post - ‏2013-10-28T14:00:45Z by GregM_dxler
KBSri
KBSri
104 Posts

Pinned topic Copying only the specified CR Number content from one attribute to the other attribute

‏2013-10-24T12:10:25Z |

Hi ,

I need to copy the attribute content  value say 'applied CR' to the attribute ''New applied CR'

But I should copy the content only specific to particular CR i.e if the CR-363 and the content in the attribute 'applied CR' is CR-363: Shri CR-464: John , then if it should copy the contents of the particular CR-363: Shri to the attribute 'New applied CR' .

Imp: It should not copy the CR-464: John to the attribute 'New applied CR'.

Any help very much appreciated.

As of now my coding copies all the content  from the attribute 'applied CR' to the attribute 'New applied CR' but it should not copy all the contents.

Thanks,

Shri

  • KBSri
    KBSri
    104 Posts

    Re: Copying only the specified CR Number content from one attribute to the other attribute

    ‏2013-10-28T05:42:40Z  

    Can anyone please help me out?

  • GregM_dxler
    GregM_dxler
    166 Posts

    Re: Copying only the specified CR Number content from one attribute to the other attribute

    ‏2013-10-28T14:00:45Z  
    • KBSri
    • ‏2013-10-28T05:42:40Z

    Can anyone please help me out?

    Sounds like you need to use a regular expression.  We do something similar, but have each entry in the applied CR column as a separate line, which makes it easier to loop through all entries.  We also use a script to do the change, so the user must be entering the CR number anyway.  So, maybe you want all entries with the same "CR-363:" with anyone's name at the end?  Here is a little dxl to use a regular expression.  Maybe this will give you some help.

    Object o = current
    string s = o."_CR number" ""
    Regexp reTest = regexp2 "(CR-)([0-9]+)(:\\ )([a-zA-Z]+)"
    while (reTest s) {
       print "Found match" " match=" s[match 0] "**\n"
       s = s[end 0:]
    }
     

    Hope it helps,

    Greg