Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I copy all text after = character?

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=Требуется биометрическое сканировани

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading