-
Notifications
You must be signed in to change notification settings - Fork 0
Writing a tab-separated file #1
Copy link
Copy link
Open
Description
This is the code we saw earlier:
split_st_1 = ["Sentence1", "Sentence2", "Sentence3"] # list of lines of one text
split_tt_1 = ["Oración1", "Oración2", "Oración3"] # list of lines of the other text
with open("translation_memory.csv", "w", encoding = "utf-8") as f: # open file to overwrite
f.write("EN\tES\n") # write heading
for x, y in zip(split_st_1, split_tt_1): # go through each pair of lines
f.write(f"{x}\t{y}\n") # write the lineWhen you open it later with pandas, remember to specify that the separator is '\t'!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels