-2

I'm trying to translate a game There are 60 thousand rows i need to extract all russian text with a loop to new txt file and After the translation is finished, I need to put them back in order.

how can i do this in python or other easy way. How can I copy text after the equals symbol in loop?

test=ПРОЦЕСС ПРЕРВАН
test2=АВТОРИЗОВАННЫЙ ДОСТУП
test3=Доступ к базе данных
test4=Подделка записей
test5=Анализируется
test6=Требуется биометрическое сканировани
petezurich
  • 9,280
  • 9
  • 43
  • 57
  • 1
    Use `split()`: `print("test=ПРОЦЕСС ПРЕРВАН".split('='))` – JNevill Aug 30 '22 at 18:16
  • 1
    Not sure you even need Python. You could do this in a spreadsheet. When importing text file, use `=` as delimiter. – bfris Aug 30 '22 at 18:21

1 Answers1

1

You can split the string by the "=" character and stop it after the first occurrence.

# lines are the lines of your file
for line in file_lines:
    # This will split your string into an array for every time that finds an 'equal' character.
    # Using 1 as second parameter will stop the split action after the first occurrence
    # after that you need just to write this new variable into your second file
    formatted_line = line.split("=", 1)[1]