Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing different language to different files or chunks of file #7

Open
li-xuyang28 opened this issue Aug 8, 2021 · 2 comments
Open

Comments

@li-xuyang28
Copy link

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
Copy link
Author

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

@ZJaume
Copy link
Contributor

ZJaume commented Jun 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants