again I have a question:
I have to convert several CSV files to some kind of XML. The Perl script reads all CSV and builds several lists and hashes.
To sum it up:
There are 1500 messages overall, but the script only works for 1495! The remaining 5 messages aren't properly handled. Why?
In detail:
The CSV lines all look like this
This is one of those that DON'T work, but I didn't recognize any difference to any other line so far.Fehler_SWCA_UgaUgeMSG ,M_sw_canInter,506,KL_FAT,BHI, +AUS_DEFAULT,AKT_NOTAUS,"""MSG Ueberlauf""","""UGA UGE MSG Ueberlauf"" +",""" """
The text between the groups of '"""' should show up in the result file as XML element. The structure should look like this:
But it actually does look like that:<MSG id="E_Fehler_SWCA_UgaUgeMSG"> <TXT_S> <TXT lang="de">"MSG Ueberlauf"</TXT> </TXT_S> <TXT_L> <TXT lang="de">"UGA UGE MSG Ueberlauf"</TXT> </TXT_L>
We see that not only the content of the <TXT> elements is missing, but the WHOLE LINE! What's going on there??<MSG id="E_Fehler_SWCA_UgaUgeMSG"> <TXT_S> </TXT_S> <TXT_L> </TXT_L>
I set some kind of debug output in my perl script, which looks like this:
In my shell window I get that output:foreach $txt (@{$txtById{$id}}) { print OUTFILE "\t\t<TXT_S>\n"; if ($msg->{id} eq "E_Fehler_SWCA_UgaUgeMSG") #DEBUG OUTPUT { print "$msg->{id}\nTXT =\n$txt->{id}\n$txt->{lang}\n$txt->{txt +S}\n$txt->{txtL}\n"; } print OUTFILE "\t\t\t<TXT lang=\"$txt->{lang}\">\"$txt->{txtS}\"</ +TXT>\n"; print OUTFILE "\t\t</TXT_S>\n"; print OUTFILE "\t\t<TXT_L>\n"; print OUTFILE "\t\t\t<TXT lang=\"$txt->{lang}\">\"$txt->{txtL}\"</ +TXT>\n"; print OUTFILE "\t\t</TXT_L>\n"; }
which is what I expected.E_Fehler_SWCA_UgaUgeMSG TXT = E_Fehler_SWCA_UgaUgeMSG de MSG Ueberlauf UGA UGE MSG Ueberlauf
Thanks in advance for helping,
Faltblatt
In reply to print line not showing up by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |