Dear all,
this is what I want to do:
I have 2 plain text files (UTF-8) with the same number of lines in both files. One is a source file, the other is a translation of the source file. Line X in the source file corresponds to line X in the target file.
I would like to create an XML file (TMX format defined by LISA) with this simple structure:
<?xml version="1.0"?>
<tmx version="1.4">
<header creationtool="AMS" datatype="PlainText" segtype="sentence">
</header>
<body>
<tu tuid="1">----------------------------- this is the line numer
<tuv xml:lang="EN">
<seg>Line number one</seg>-------------- this is from the first file
</tuv>
<tuv xml:lang="FR">
<seg>Ligne numéro un</seg>-------------- this is from the second file
</tuv>
</tu>
</body>
</tmx>
There are tools that exist to do this (using Java) but they all run into memory problems if I try to merge text files of 20 MB.
Is this something that I could do with AMS / LUA ?
Should I read the TXT files to a table first, and then merge the tables to XML?
If anyone can give me advice or point me to some example code, that would surely help.
thanks
Gert
this is what I want to do:
I have 2 plain text files (UTF-8) with the same number of lines in both files. One is a source file, the other is a translation of the source file. Line X in the source file corresponds to line X in the target file.
I would like to create an XML file (TMX format defined by LISA) with this simple structure:
<?xml version="1.0"?>
<tmx version="1.4">
<header creationtool="AMS" datatype="PlainText" segtype="sentence">
</header>
<body>
<tu tuid="1">----------------------------- this is the line numer
<tuv xml:lang="EN">
<seg>Line number one</seg>-------------- this is from the first file
</tuv>
<tuv xml:lang="FR">
<seg>Ligne numéro un</seg>-------------- this is from the second file
</tuv>
</tu>
</body>
</tmx>
There are tools that exist to do this (using Java) but they all run into memory problems if I try to merge text files of 20 MB.
Is this something that I could do with AMS / LUA ?
Should I read the TXT files to a table first, and then merge the tables to XML?
If anyone can give me advice or point me to some example code, that would surely help.
thanks
Gert
Comment