• Login
Community
  • Login

Replace a specific word to reinsert the word one character before

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 221 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    Josef Mörtl
    last edited by Sep 15, 2021, 1:03 PM

    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.
    nachqualifiziert
    D-1-7133-0220 Mittelalterliche und frühneuzeitliche Befunde.
    nachqualifiziert
    D-1-7133-0221 Siedlung der römischen Kaiserzeit. nachqualifiziert
    D-1-7133-0307 Siedlung der Frühlatenezeit.
    nachqualifiziertNotepad ++ Forum Replace.jpg

    A 1 Reply Last reply Sep 15, 2021, 1:09 PM Reply Quote 0
    • A
      Alan Kilborn @Josef Mörtl
      last edited by Sep 15, 2021, 1:09 PM

      @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.

      J 1 Reply Last reply Sep 15, 2021, 3:11 PM Reply Quote 2
      • G
        guy038
        last edited by guy038 Sep 15, 2021, 2:01 PM Sep 15, 2021, 1:53 PM

        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

        or

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

        • REPLACE Leave EMPTY

        • Tick the Wrap around option

        • Select the Regular expression search mode

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 1
        • J
          Josef Mörtl @Alan Kilborn
          last edited by Sep 15, 2021, 3:11 PM

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

          1 Reply Last reply Reply Quote 1
          1 out of 4
          • First post
            1/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors