Help replacing some numbers
-
First of all, sorry for my English, I’m not a native speaker.
So tried looking for a way to solve this but i didnt found it and i cant solve it alone (im kinda dumb).I have a big file with thousands of lines like this
“DETAILED_FUTURE_REGEN” “Abdullah” “” “Fusseini” “01/07/2006” “21” “” “3” “18” “15” “180” “78” “0” “MIDFIELDER_CENTRAL” “” “Accra” “120” “145” “1174”
“DETAILED_FUTURE_REGEN” “Othmane” “” “Hamama” “03/07/2006” “769” “” “1” “7” “11” “182” “75” “1” “DEFENDER_LEFT_SIDE” “” “Rambouillet” “75” “135” “886”
“DETAILED_FUTURE_REGEN” “Martinho” “Paíto” “Martins Mukana” “05/07/2006” “35” “” “3” “18” “16” “170” “70” “1” “DEFENDER_LEFT_SIDE” “” “Maputo” “120” “140” “1489”
“DETAILED_FUTURE_REGEN” “Javi” “” “Paredes” “05/07/2006” “796” “” “1” “5” “15” “175” “72” “3” “DEFENDER_LEFT_SIDE” “” “Oviedo” “120” “145” “1741”And i need that the antepenultimate “” to always be “75” to make the lines like this
“DETAILED_FUTURE_REGEN” “Abdullah” “” “Fusseini” “01/07/2006” “21” “” “3” “18” “15” “180” “78” “0” “MIDFIELDER_CENTRAL” “” “Accra” “75” “145” “1174”
“DETAILED_FUTURE_REGEN” “Othmane” “” “Hamama” “03/07/2006” “769” “” “1” “7” “11” “182” “75” “1” “DEFENDER_LEFT_SIDE” “” “Rambouillet” “75” “135” “886”
“DETAILED_FUTURE_REGEN” “Martinho” “Paíto” “Martins Mukana” “05/07/2006” “35” “” “3” “18” “16” “170” “70” “1” “DEFENDER_LEFT_SIDE” “” “Maputo” “75” “140” “1489”
“DETAILED_FUTURE_REGEN” “Javi” “” “Paredes” “05/07/2006” “796” “” “1” “5” “15” “175” “72” “3” “DEFENDER_LEFT_SIDE” “” “Oviedo” “75” “145” “1741”Usually the number in the “” that i want to be 75 is either 120 or 140 but i dont know how to replace it without changing other ocurrences that also have 120/140
Thank you in advance.
-
Hello, @manuel-rodríguez and All,
Easy with regular expressions !
So :
-
Open your file within Notepad++
-
Move to the very beginning of your file (
Ctrl + Home
) -
Open the Replace dialog (
Ctrl + H
) -
Untick all box options
-
SEARCH
"\d+(?=" "\d+" "\d+"$)
-
REPLACE
"75
-
Tick the
Regular expression
search mode -
Click once the
Replace All
button or several times on theReplace
button
Note :
-
This regex searches for a double-quote character, followed with consecutive digits chars (
\d+
), but ONLY IF it is followed with two other zones of digits, surrounded by double-quotes and separated with aspace
char, till the end of current line$
-
In case of match, it replaces the double-quote, followed with the digits zone, by
"75
Here you are !
Best Regards,
guy038
-