Skip to main content

Search

Search

Separate string from DMC in individual data according separators

Comments

2 comments

  • Avatar
    Laura Vela
    Moderator

    Hello Martin,

    Thank you for using our forums.

    Since you have BarTender v2016, the only options available to achieve this are:

    * Option 1: Using Transform options (within the properties of a text object)

    * Option 2: Using VB Script

    The availability of those two options is going to depend on the edition that you have.

     

    Option 1 - Using transform options

    The key thing when using the Transform options to adapt the portion of the text we want to display, is making use of the Object Value data type:

    As you can see, I have created a text object and used the Object Value option so that it reads the contents of Text 1 (which is the main data source, marked in red). Using Object Value allows us to make changes to our data without modifying the original data source. This way, we can make use of several Transform actions:

     

     

    To isolate the value that we want. We can use similar steps for the different identifiers.

     

    Option 2 - Using VB Script

    The idea would be similar but since the number of character is variable, it complicates things a bit. However you might find the following example helpful:

    https://software-solutions-online.com/vba-remove-characters-from-string/#Example_2_8211_Remove_a_Variable_Number_of_Characters_from_the_Right

    Basically you locate the separator on the string, then with a counter you can count up the number of characters on for each piece of data and afterwards we remove them using the calculated number of characters.

     

    I hope this helps!

    0
  • Avatar
    Martin J

    Hello Laura, 

    thank you for your answer. I think  option 1 is fine for me.

    Have a nice day.

    Martin.

    0

Please sign in to leave a comment.