Split a string into a table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sdfsf93924554234fjfjf
    Indigo Rose Customer
    • Mar 2007
    • 19

    Split a string into a table

    Hi, in quite a few other scripting languages there is often a function to convert a string into an array. This usually follows the form of..

    string splitCharacter result

    i.e.

    myString ";" myStringArray

    and the original string would have a number of ; in it where you want it to be split. How is this accomplished in AMS? I can't find any function that replicates this functionality

    Cheers

    CT
  • holtgrewe
    Indigo Rose Customer
    • Jul 2002
    • 779

    #2
    I don't think there is a single command to do this; however you can manipulate 'Strings' however you want.

    I'm not the greatest coder but this will give you some example of working with strings to accomplish what you wanted.

    In this example I've loaded a table with a string delimited by 'spaces' and placed a different delimiter in the table. However you should never need delimiters in a table for this purpose.

    Some of the coding gurus could turn this into a nice compact little function.
    Attached Files
    Last edited by holtgrewe; 01-09-2008, 06:45 PM.

    Comment

    • sdfsf93924554234fjfjf
      Indigo Rose Customer
      • Mar 2007
      • 19

      #3
      Thanks for that example holtgrew. I am surprised though this does not exist as a standard function. I guess I'm kind of used to other scripting languages such as Perl and Python having this kind of functionality. But I also script in Maya (3D gfx app) and that also has this kind of command.

      If anyone out there would be kind enough to put together a function that does this, I'm sure it would come in useful for many others down the line.

      Cheers

      CT

      Comment

      • holtgrewe
        Indigo Rose Customer
        • Jul 2002
        • 779

        #4
        Heres a link to another, it may work better for you...



        ...there is so much great info in this forum.

        hth

        Comment

        Working...
        X