Topic
  • 2 replies
  • Latest Post - ‏2013-03-25T07:31:59Z by btela2000
btela2000
btela2000
19 Posts

Pinned topic variation to partial string view from another attribute

‏2013-03-19T03:07:05Z |
Hello, thank you for the help thus far. I figureed out how to hard code if there are no IDs designated listed as "None" and simply show the same:

Object o
o= obj
Module m = current
string VerIds = o. "Verification IDs"

if (VerIds == "None") {
obj.attrDXLName = ("None")
} else {
obj.attrDXLName = (probeAttr_(obj, "Verification IDs"))[0:2]
}

I have carriage returns in my data, however, and I need to show multiple strings. For instance i have MEM1234
ELM1234
FLM1234

and I would want to show all three MEM, ELM, and FLM in my attribute. I guess I would need to separate the strings by carraige return (i think it's: "\n")

thanks, John
Updated on 2013-03-25T07:31:59Z at 2013-03-25T07:31:59Z by btela2000
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: variation to partial string view from another attribute

    ‏2013-03-19T08:32:59Z  
    This will be a little more complex, as I assume that in the case you have
    ELM1234
    FLM1234
    ELM2345

    the result shall look like
    ELM
    FLM
    with ELM not being repeated.

    a rough draft:
    You will have two loops.
    Before the first one, create a String Skip list.
    In the first loop, split your attribute into separate lines, for each line extracting the first three characters. Put the result into the Skip list, using your result as both value and key, this way you can ensure that only unique values will be available.
    In the second loop, combine all values contained in the Skip list into one string (plus a CR at the correct places).
    Afterwards, set obj.attrDXLName to this combined string and delete the Skip list.

    About splitting the string into separate lines, you could use the example in the DXL help, section "Regular expressions" (while (!null txt1 && line txt1))
  • btela2000
    btela2000
    19 Posts

    Re: variation to partial string view from another attribute

    ‏2013-03-25T07:31:59Z  
    This will be a little more complex, as I assume that in the case you have
    ELM1234
    FLM1234
    ELM2345

    the result shall look like
    ELM
    FLM
    with ELM not being repeated.

    a rough draft:
    You will have two loops.
    Before the first one, create a String Skip list.
    In the first loop, split your attribute into separate lines, for each line extracting the first three characters. Put the result into the Skip list, using your result as both value and key, this way you can ensure that only unique values will be available.
    In the second loop, combine all values contained in the Skip list into one string (plus a CR at the correct places).
    Afterwards, set obj.attrDXLName to this combined string and delete the Skip list.

    About splitting the string into separate lines, you could use the example in the DXL help, section "Regular expressions" (while (!null txt1 && line txt1))
    Hey folks, thank you for the support! check out the other thread that is under the same subbect title for my solution. thanks again everyone for your help! John