Questions about reading files

Hello forum,

I’m quite new on using Unity and i’m having troubles on some things, mainly about file reading.
I would want to know, if possible:

1º How do you make a pop-up window that asks you for a string/filename? (Or better, a file browser window where you can select a file).

2º For the structure of the file, i want it to be something like this(but not exactly like this):

[A1]
Sound="SoundA1.wav"
Image="A1.jpg"
Image_Final="A1_Final.jpg"
ImageB="B1.jpg"
ImageC="C1.jpg"
Top_Row=X,A4,X
Middle_Row=A2,X,X
Bottom_Row=A2,A3,X

[A2]
........

[A3]
.......

--------

[AX]
.......

Knowing that it can have any number of [AX], how do i read the file with that structure and store the variables? Is it better to read all of it at the start and store all the variables(I was thinking of storing all the data in separate arrays, one for sounds, one for images, etc, or is there a better way to store variables?), or read them when needed?.
Notes:
-The 3 rows will all be stored on the same array. (for example, array [“A2”(2)] [“1ºposition of middle_row”(3)]=“A5”)
-The program doesn’t write the file, only reads them.
-Performance issues are not a big problem for this project, since its for research purposes.

3º The file is in “.txt” but i’ve been reading that “.XML” is better at storing and reading variables. Which format should i use?

Thank in advance for the help.

For a file browser you can try http://unifycommunity.com/wiki/index.php?title=FileBrowserWithColumns or http://unifycommunity.com/wiki/index.php?title=ImprovedFileBrowser.

Personally I like to use json.NET for writing and reading, but also you can investigate System.IO. Here you have some examples for txt files, http://msdn.microsoft.com/en-us/library/db5x7c0d.aspx and http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx.

I don’t know about any Unity specifics with regards to file IO, but, I would recommend using XML for your file structure since what you showed us here is key/value based.

Listen to guitboxgeek, don’t do it the way you are. Over complicated to read and parse.

Thanks for the answers, got everything to work nicely using json.net (was easier than expected).