Saving to CSV



  • Hi everyone,
    I made a post originally a couple of months ago, but have been unable to reply until now because of some personal issues. In any case, I've been looking for help into how to export/save my game information to a CSV file. I will be saving info like player id, time intervals between button presses, and a few different scores, all created as arrays. Someone replied to my original post by pointing me out to http://x01010111.com/haxeflixel.php and the associated tiled map editor. This, unfortunately, is not what I need. I don't need to create a csv to then parse it to haxeflixel. What I need is to automatically save all of the game information to this file, so that I can then open this file with something like Excel.
    Any help would be really appreciated!! As I mentioned in my original post, I'm a newbie at programming in general.

    Thanks in advance!!



  • What you want is called (de)serialization. There are some means in Haxe to simplify the process for JSON (http://api.haxe.org/haxe/Json.html) and its own format (http://api.haxe.org/haxe/Serializer.html).
    There are some libs for CSV at github (https://github.com/search?utf8=✓&q=haxe+csv), don't know how automatic they are though. You can also read the FlxTilemap CSV parsing code to get the idea.



  • @starry-abyss
    Thanks a lot. As I said I'm really new to programming and it looks quite intimidating. I'll start working on it.


Log in to reply