I'm having serious bad times dealing with file parsing. Here's a link to this folder, inside it there's a fileparse.bgt which you will find to be a very very simple code, open a file in read mode, pass it's content to a string variable, then pass it to another file object then save it.
So, as you'll notice when you run it, the resulting new_spoiler.txt file is totally messed up with line breaks and line order.
Any insights welcome. I'll give the big picture so you can try to help me furthermore:
I'm playing with the idea of making a very simple Magic: the Gathering P2P client using BGT. I wrote a Card class with all the data structure I need, and I declared a dictionary where I intend to store all cards with a single numeric key for each one. This dictionary can then be serialized to a file and used in the Deck Editor.
First I went to Google and got this spoiler.txt file, which contains all cards from a specific edition. I'm starting with a few cards for testing, then I'll get the full card listing when the parser works. My idea was to declare a card object, then go inside a loop and parse properties to it, then send it to the dictionary and start over the loop. When it reaches end of file the deck dictionary should have one entry for each card and be ready to serialize.
Right now I'm stuck with parsing this spoiler.txt file, whether by read_until or by string_split, because it's totally messing up with line breaks.
Help!