How to replace only in rows with a special text?
-
Hello, I want to replace text but only in rows that have a special text. Example:
file: image1_5000x5000.png, projectID: 1234
file: image2_5000x5000.png, projectID: 5678
file: image3_4000x4000.png, projectID: 1234Now I want to replace 5000x5000 with 45000x4500 but ONLY in the rows where I have the text “projectID: 1234”
So after the replacement I have this:file: image1_4500x4500.png, projectID: 1234
file: image2_5000x5000.png, projectID: 5678
file: image3_4000x4000.png, projectID: 1234How can I do that?
-
given your example data you could do
find what:5000x5000(?=.*?projectID: 1234)
replace with:4500x4500
having Regular expression checked. -
@Ekopalypse said in How to replace only in rows with a special text?:
5000x5000(?=.*?projectID: 1234)
Thank you. That worked.