Replace a specific word to reinsert the word one character before

  • Hallo there,

    can anybody please help me to solve this problem. It`s not for commercial use but only for my privat hobby.

    I am working on a list of bavarian monuments. I transferred the list from PDF files to
    Notepad ++. Afterwards I want to import the list into an Excel worksheet.

    Unfortunately, the formatting was not transferred perfect, so that now the word “nachqualifiziert” stands in some lines alone, but it should be at the end of the line before.

    Is it possible to search the whole text for “nachqualifiziert” where it is alone in a line
    and then replace it in such a way, that it is set back by one character -
    like when you press the backspace button so it is than at the end of the line before

    D-1-7133-0198 Spätmittelalterliche und frühneuzeitliche Befunde. nachqualifiziert
    D-1-7133-0199 Mittelalterliche und frühneuzeitliche Befunde.nachchqualifiziert
    D-1-7133-0200 Frühneuzeitliche Befunde . nachqualifiziert
    D-1-7133-0202 Frühneuzeitliche Befunde . nachqualifiziert
    D-1-7133-0211 Mittelalterliche und frühneuzeitliche Befunde.
    D-1-7133-0220 Mittelalterliche und frühneuzeitliche Befunde.
    D-1-7133-0221 Siedlung der römischen Kaiserzeit. nachqualifiziert
    D-1-7133-0307 Siedlung der Frühlatenezeit.
    nachqualifiziertNotepad ++ Forum Replace.jpg

  • @Josef-Mörtl said in [Replace a specific word to reinsert the

    Maybe search for \R(nachqualifiziert)$ and replace with ${1} using Regular expression search mode.

  • Hello, @josef-mörtl, @alan-kilborn and All,

    An other solution could be :

    • SEARCH (?-i)\R(?=nachqualifiziert), as long as the word nachqualifiziert begins the next line


    • SEARCH (?-i)\R(?=nachqualifiziert$), if the word nachqualifiziert must begin and end the next line


    • Tick the Wrap around option

    • Select the Regular expression search mode

    Best Regards,


  • Hey guys … sooo fast … you guys are fantastic … both solutions worked perfectly … thousand thanks from bavaria

Log in to reply