Rob said:
Ok thanks for your quick responses. I want this so the user does not
have to perform any imports on the Excel side.
This below looks promising, but I don't know much about these
applications. I only know how to create simple shell scripts. I may
be able to create one that reads in each line and echoes what I need
to create an xml document. I think I'm going to have to do something
like that.
Do you know awk? Here is a small awk command that will output
something that _may_ be well-formed XML (assuming the first line
contains field names). Adapt at your will, be careful with encodings
and quoting in the initial data, plug in your specific tags. And don't
expect too much.
awk -F'\t' '
BEGIN { printf("<file>\n"); }
NR==1 {
for ( i=1 ; i<=NF ; i++ )
name
= $i;
}
NR>1 {
for ( i=1 ; i<=NF ; i++ )
printf("<%s>%s</%s>\n",name,$i,name);
}
END { printf("</file>\n"); }
' yourfile.csv
-- Alain.