User Tag List

Results 1 to 7 of 7

Thread: How can I do this properly?

  1. #1
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,355
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)

    How can I do this properly?

    When I have a file with several comma delimited entries like this

    1,name,43,65,h
    2,name,12,4,v
    3,name,1,45,v

    etc

    How can I read it and write it to a formatted text file like this

    [1]
    name=name
    x=43
    y=65
    z=h
    [2]
    name=name
    x=12
    y=4
    z=v

    etc

    I've been playing with the string parser and set the delimiter to a , and use the read file within it, but the output it just garbage symbols.
    Unless I am using the delimiter the wrong way in this case.. Normally I just do 1 line, but since there is a file load option in it...

    Any suggestions?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,350
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    For this I wouldn't use the String Parser. It's too limited for this purpose. Use the String Tokenizer and it's 2D split functionality, and set X delimiter to Newline$ and Y delimiter to ",".
    Then run a loop as many times as there are X 2D elements and take it from there

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    alexexhowl's Avatar
    Join Date
    Jan 2015
    Location
    RU, YKT
    Posts
    357
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    @Perry making level editor? here my method array to ini.mfa

  4. #4
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,355
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by alexexhowl View Post
    @Perry making level editor? here my method array to ini.mfa
    Looks nice, but since the data is already in a text file, how do I read that. That's where I get stuck at.

    @Popcorn , let me look into the Tokenizer with the Split option

    Still suck on how to read the text file line by line, with the data from the 1st post, before i can process it.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,283
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    I would load your original formatting to a List, then simply parse each line of the list in a fastloop. You can then write back out the formatting you want on each Fastloop loop. Something like:

    +On Loop "parse"
    --Set Alterable String A to "["+ParserElement0+"]"+Newline$+"name="+ParserElement1+Newline$+etc ...

    Or you could write it out line by line into a new List object and save that out as a text file.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    What Mobichan said
    A string tokenizing extension will make your life a little easier, although it's pretty simple to do without any extensions, just using the built-in string functions.
    eg.
    parse.mfa

  7. #7
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,355
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    thank you all, sometimes the easiest solution I miss, and thinking the hard way.

Similar Threads

  1. How to get data from the server properly?
    By CG_action in forum Fusion 2.5
    Replies: 3
    Last Post: 27th July 2015, 02:24 PM
  2. Negate not working properly?
    By Perry in forum Fusion 2.5
    Replies: 9
    Last Post: 7th December 2014, 12:15 AM
  3. closing an app properly?
    By Perry in forum Android Export Module 2.5
    Replies: 14
    Last Post: 21st April 2014, 11:20 PM
  4. I can't spread values properly
    By EdibleWare in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th January 2012, 07:54 PM
  5. Words not bouncing properly?
    By vesperillo in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th April 2010, 06:43 PM

Posting Permissions

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