Community
    • Login

    Seperate a format in rows

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 843 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.
    • ph0enixP
      ph0enix
      last edited by

      Hello all,
      So I have this kind of format of numbers and texts on my notepad++ document and I’d like to separate the the first part which is the numbers than the second part which is from @ until the ; and the last part from ; and the last and i want them in 3 different notepads? It’s kind of complicated if a lot, thank you if this is possible.

      123.456.78.0:22000@Name\Name123;name
      12.3.456.789:10000@NAME\Name-1;Name2017

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @ph0enix
        last edited by

        @ph0enix

        If I were you I’d create 3 new copies of your data in 3 new Notepad++ tabs.

        Then taking each new tab in turn, do the following:

        Tab #1

        Find what zone: ^([^@]+)@(?-s).+
        Replace with zone: \1
        Wrap around checkbox: ticked
        Action: Press Replace All button

        Sample results:

        123.456.78.0:22000
        12.3.456.789:10000
        

        Tab #2

        Find what zone: ^[^@]+@([^;]+);(?-s).+
        Replace with zone: \1
        Wrap around checkbox: ticked
        Action: Press Replace All button

        Sample results:

        Name\Name123
        NAME\Name-1
        

        Tab #3

        Find what zone: (?-s)^.+?;(.+)$
        Replace with zone: \1
        Wrap around checkbox: ticked
        Action: Press Replace All button

        Sample results:

        name
        Name2017
        

        Of course, all this keys upon the @ and ; occurring in the data where the examples show…and nowhere else. It will need some changes if this is not always true

        1 Reply Last reply Reply Quote 2
        • guy038G
          guy038
          last edited by

          Hello @ph0enix, @Scott-sumner and All,

          if the general template of your data is always :

          ........@..........;......

          Here are, below, 3 other possible regex S/R. Similarly to Scott’s post, you must select the Regular expression search mode, tick the Wrap around option and click on the Replace All button. Note that the Replace with: zone is always Empty

          First regex :

          SEARCH (?-s)@.+

          REPLACE Empty

          Results :

          123.456.78.0:22000
          12.3.456.789:10000
          

          Second regex :

          SEARCH (?-s).+?@|;.+

          REPLACE Empty

          Results :

          Name\Name123
          NAME\Name-1
          

          Third regex :

          SEARCH (?-s).+;

          REPLACE Empty

          Results :

          name
          Name2017
          

          Best Regards,

          guy038

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