Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173

    Need help on parsing a string

    I am scratching my head with this but i am sure that it will be obvious for one of you:

    i have a variable that contains data in the following format:

    DOMAIN\USER


    I want to retrieve both items, Domain and User, and place each into its own variable. Now the lentgh of "Domain" and "USER" is not always the same so...Anyone can help me out with that?

    Thanks in advance

    Martin

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Not a problem. Since the length is different you can treat it as a delimited string. Use the String.GetDelimited function to get both index 0 and index 1 and use the \ as your delimiter.

    %SourceString% = "DOMAIN\USER"
    %domain% = String.GetDelimitedString ("%SourceString%", "\", 0)
    %user% = String.GetDelimitedString ("%SourceString%", "\", 1)

  3. #3
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi Martin. There are a couple ways to approach this, but to keep it simple why not treat it as a tab delimited string which uses \ as the delimiter...

    So you would use a STRING > GET DELIMITED STRING action to extract whatever data you need and place it into variable(s) of your choice, i.e. %myItem1%, %myItem2%, %myItem3%, etc...

    Corey Milner
    Creative Director, Indigo Rose Software

  4. #4
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    ahhhhhhhhh! I new it was simple! (for you at least)

    thanks guys

    Martin

    EDITED BY COREY

  5. #5
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Martin, please be more careful what comments you post here in the AutoPlay Media Studio 4.0 forum, thanks...

    Corey Milner
    Creative Director, Indigo Rose Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts