tmxt icon indicating copy to clipboard operation
tmxt copied to clipboard

Writing different language to different files or chunks of file

Open li-xuyang28 opened this issue 3 years ago • 2 comments

Hi there,

Thanks for creating such a wonderful tool! I was wondering if it is possible to write to separate txt files based on language codes, or write them into different chunks of text (instead of \t separated)?

Best

li-xuyang28 avatar Aug 08 '21 02:08 li-xuyang28

Say if we have two languages (represented by a and b) Currently the output would be:

aaaaaa    bbbbb
aaaaaa    bbbbb

I was wondering if it's possible to write as"

aaaaa
aaaaa
bbbbb
bbbbb

li-xuyang28 avatar Aug 08 '21 02:08 li-xuyang28

You can do it easily with bash. For

aaaaa
aaaaa
bbbbb
bbbbb

you can simply do:

python tmxt.py --codelist=a,b file.a-b.tmx | tr '\t' '\n' >file.a-b.txt

Or for separated files:

python tmxt.py --codelist=a,b file.a-b.tmx | tee $(cut -f1 >file.a.txt) | cut -f2 >file.b.txt

ZJaume avatar Jun 27 '22 12:06 ZJaume