Marco Trapanese wrote:
Quote:
I have to define a structure for a plain-text input file.
Quote:
1) should I use an xml file?
Yes!
Bear in mind that Xml is good for holding things and retrieving them,
but not so good at extracting values and then breaking them up (you have
to code for that) so break your data down as far as you (sensibly) can,
then you can read and reassemble items later.
Something like this would do:
<file>
<header
title="W"
description="X"
other_1="Y"
other_2="Z"
/>
<data>
<row number="1">
<col number="1" >10</col>
<col number="2" >45.2</col>
<col number="3" >Hello! This is a string, indeed.</col>
</row>
<row number="2">
<col number="1" >-56.1234</col>
<col number="2" >Gilligan's Island</col>
<col number="3" >42</col>
</row>
</data>
</file>
Quote:
2) how can I manage strings? Strings might contain ',' that is the
separator character.
Single quotes have to be escaped/encoded as &apos but, if you use any of
the Xml classes to manipulate your data (System.Xml Namespace), this
will all be taken care of for you.
HTH,
Phill W.