I have a translation file that looks like this:
…500+ more lines like that
now I have a file I need to work on with text. Only certain parts of text needs to be replaced, example:
The ((Apple)) was next to the ((Banana)). Meanwhile the ((Cherry)) was chilling by the ((Train)).
Result needs to be
The ((Apfel)) was next to the ((Banane)). Meanwhile the ((Kirsche)) was chilling by the ((Zug)).
There are way too many incident to copy/paste manually. What is an easy way to search for ((XXX)) and replace from another file as mentioned? I tested
separators = "=", "n"
def custom_split(sepr_list, str_to_split):
# create regular expression dynamically
regular_exp = '|'.join(map(re.escape, sepr_list))
return re.split(regular_exp, str_to_split)
with open('D:/_working/paired-search-replace.txt') as f:
for l in f:
s = custom_split(separators, l)
But it also replaces unwanted stuff e.g. ((File:Apple.png)) with ((File:Apfel.png)) and that’s not supposed to happen.
i have 2 strange things i have noticed when using my sharepoint list:
Could anyone tell me what these signs and symbols are: