0

Trying to find and replace some xml syntax. Not quite sure how to add text after a certain line. I am adding a line after the < br> tag, but there are too many < br> so I am trying to specific it to the br after "Place".

Another situation where I need to remove the line, the beginning, the end and between.

The Body

< br>
place: < br>
Area: 1< br>
< br>
place: KITTE< br>
Area: 2< br>
  • Case 1.

FIND: Place: something < br>

REPLACE with: Place: something < br>name: < br>

FIND: Place: < br>

REPLACE with: Place: < br>name: < br>

  • Case 2.

FIND: Area: something < br> OR Area: < br>

delete this line

  • Please edit and include some real example text - before and after your required changes (one set for each of your cases). – DavidPostill Mar 7 '16 at 11:56
0

Case 1

  • Menu "Search" > "Replace" (or Ctrl + H)

  • Set "Find what" to ^place: (.*)< br>

  • Set "Replace with" to place: \1< br>name: < br>

  • Enable "Regular expression"

  • Click "Replace All"

    enter image description here

Before:

< br>
place: < br>
Area: 1< br>
< br>
place: KITTE< br>
Area: 2< br>

After:

< br>
place: < br>name: < br>
Area: 1< br>
< br>
place: KITTE< br>name: < br>
Area: 2< br>

Case 2

  • Menu "Search" > "Replace" (or Ctrl + H)

  • Set "Find what" to ^Area: (.*)< br>(?:\r?\n?|$)

  • Set "Replace with" to an empty string

  • Enable "Regular expression"

  • Click "Replace All"

    enter image description here

Before:

< br>
place: < br>name: < br>
Area: 1< br>
< br>
place: KITTE< br>name: < br>
Area: 2< br>

After:

< br>
place: < br>name: < br>
< br>
place: KITTE< br>name: < br>

Further reading

  • thank you very much, I still haven't got the change to try the answer, yet. – Maki Mar 18 '16 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.