Replace text inside Quotations
-
Hello,
I am struggling to find an answer to my problem.
I have a large text file that has lots of strings similar to the below:-
translation=“-56.3568 13.54 94.6262”
translation=“116.799 17.376 -142.61”
translation=“38.3606 5.67512 204.685”Each middle number inside the quotes is different but I want them to read all the same, like this:-
translation=“-56.3568 10.2 94.6262”
translation=“116.799 10.2 -142.61”
translation=“38.3606 10.2 204.685”Is that even possible with Notepad++?
Many thanks,
Greeham
-
@geeman72 said in Replace text inside Quotations:
translation=“-56.3568 13.54 94.6262”
translation=“116.799 17.376 -142.61”
translation=“38.3606 5.67512 204.685”A quick one that is not entirely rigorous, but fits your data:
Find:
([\d.-]+) [\d.-]+ ([\d.-]+)
Replace:${1} 10.2 ${2}
Search mode: Regular expressionMore relevant info:
-
That’s great thank you, one other question if I might, I forgot to mention there are other strings that are made up of 3 sets of numbers as well but don’t want those changing, so would I add the search to include the word translation at the beginning as well?
Thanks for the help,
Greeham
-
@geeman72 said in Replace text inside Quotations:
so would I add the search to include the word translation at the beginning as well?
Certainly!
-
@Alan-Kilborn Great thanks.
I have managed it with some additional searching (since I am a new noobie) and worked with this:-
Find: (?-s)(.+?translation=")([\d.-]+) [\d.-]+ ([\d.-]+)
Replace: ${1}${2} 99.403 ${3}
Search mode: Regular expressionThanks again,
Greeham
-