• Login
Community
  • Login

Regex (or whatever) help please

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 1.7k 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.
  • C
    craig white
    last edited by Jan 18, 2017, 7:03 PM

    Hi all,
    I am stuck trying to get the last step in the re-formatting of this file and I am hoping there is a way (other than RBAR manual processing) to accomplish this. What I have is this sort of thing:


    GEASLER
    SARA L GEASLER,

    SHERMAN
    MATTHEW J SHERMAN,


    Which I would like to eliminate the blank lines and combine the other two as so:
    GEASLER, SARA L GEASLER,
    SHERMAN, MATTHEW J SHERMAN,

    I have tried and failed at all I knew and tried a few things I didn’t, no joy in Mudville. If someone could give me a push in the right direction I would greatly appreciate it.

    S 1 Reply Last reply Jan 18, 2017, 7:17 PM Reply Quote 0
    • S
      Scott Sumner @craig white
      last edited by Jan 18, 2017, 7:17 PM

      @craig-white

      Let’s get some joy back in Mudville before the big strikeout.

      It appears your data can be thought of as three lines per person, the first two lines with data, the third line as empty. This is the best I can assume from what you’ve shown. If that is true, and assuming Windows line endings of CR+LF are desired, then…

      Find what box: (?-s)(.+?)\r\n(.+?)\r\n\r\n
      Replace with box: \1,\x20\2\r\n
      Search mode: Regular expression

      …should take you a long way.

      1 Reply Last reply Reply Quote 0
      • C
        craig white
        last edited by Jan 18, 2017, 7:36 PM

        Thank you very much, I will get done what the boss wants and then com back and figure out how and why it worked. Always good to understand something better. Thanks again!

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