Hello All,
I have a question about converting a CSV file to XML format how do I do this,
Thanks for any suggestions.
Printable View
Hello All,
I have a question about converting a CSV file to XML format how do I do this,
Thanks for any suggestions.
There is a MSXml component in VB6.
use the excellent example from
http://www.inquiry.com/techtips/xml_.../10min1099.asp
if you are familiar with the sed utility (a UNIX tool that's also available for Win32 from www.gnu.org), you can write a converter in a few lines:
1i\
<?xml version="1.0"?>
1i\
<rows>
i\
<row>
s/\(.*\)/\1;/
s@\([^;]+\);@<column>\1</column>@gp
i\
</row>
$a\
</rows>
call this from a DOS commandline (or from vB via shell) like this:
sed -nf yourscriptfile yourinputfile>outputfile.xml
it creates a <row> tag for each row in the CSV file and a <col> tag for each column and all the required tags, so that you can view the result in IE 5.