User Tag List

Results 1 to 6 of 6

Thread: Looking for a way to parse text to the left and right of a single delimiter

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    CruddyBuddy's Avatar
    Join Date
    May 2010
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Looking for a way to parse text to the left and right of a single delimiter

    So I've been using string parsing and delimiters for a while, and I can parse text into elements using two delimiters, but I need to find a way to parse text into elements on either side of a delimiter.

    For example (using the delimiter #):

    element1#element2
    element3#element4
    element5#element6
    element7#element8

    I would like to be able to parse out the text on the left and right of the # to so there are 8 elements. The problem I'm running into is the linebreaks are ignored, so it treats element2 and element3 as one single element.

    I've tried parsing between two delimiters # and NewLine$ but it still doesn't work.

    Would anyone here have a good suggestion for me? I appreciate the assistance.

  2. #2
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    121
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I've done the same thing like yours.
    Try using two string parser objects.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    112
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Use the string tokeniser instead of the string parser

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Simple method would be to replace the line breaks with a different delimiter and then parse that. If the line breaks are needed you can always reformat them after.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    CruddyBuddy's Avatar
    Join Date
    May 2010
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much for your suggestions! I went ahead and replaced the linebreaks with another delimiter, which helped me to realize that my main problem is that String Tokenizer is not recognizing "" (or nothing) as an element. So if I have any line with nothing before or after the #, it will capture everything from the # through the next # to the Linebreak as an element.

    For example:

    text1#text2
    text3#text4
    text5#text6
    text7#text8

    becomes this when I replace the Linebreak with @

    @text1#text2@text3#text4@text5#text6@text7#text8@ (bold areas are what it labels as elements)

    This is perfect, and just what I need. And of course I can run it through a second time with the delimiters reversed to get the other parts tokenized. The problem is when I have this situation:

    text1#text2
    text3#
    text5#text6
    text7#text8

    String tokenizer doesn't recognize the blank space between # and @ as an element, so I end up getting output like this:

    @text1#text2@text3#@text5#text6@text7#text8@ (bold areas are what it labels as elements)

    So I need to find a way to get String tokenizer to accept the area between A# as an element, even if it's empty, so it doesn't end up tokenizing the next @ and # delimiters.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    CruddyBuddy's Avatar
    Join Date
    May 2010
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Based on the several awesome suggestions by you guys, I found a solution for my problem.

    What I did is basically replace all "#" + NewLine$ with "# @" and replace all NewLine$ with "@"
    So I ended up with a string that looks like this:
    @text1#text2@text3#_@text5#text6@text7#text8@

    Now having that extra space could muck up the code in some situations, but it doesn't for my purposes, and it allows the String tokenizer to recognize the blank area after the #.

    Thank you again for your help, everyone!

Similar Threads

  1. I need to parse some html and extract text
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th September 2011, 04:25 PM
  2. How can I parse the text from a specific HTML tag?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th October 2010, 04:40 PM
  3. How can I parse the first line of text in a file?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th October 2010, 09:47 AM
  4. Parse a text file
    By kungsangun in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th March 2008, 04:40 AM

Posting Permissions

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