• Login
Community
  • Login

How do I go from A<CR><<LF>B<CR><LF> to 'A','B' ?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 2 Posters 3.8k 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
    Jim Biwer
    last edited by Mar 29, 2016, 8:54 PM

    How to I quickly change (search/replace):

    A<CR><LF>
    B<CR><LF>
    C<CR><LF>
    D

    to

    ‘A’,‘B’,‘C’,‘D’
    ?

    I have done it before using Ultra Edit, but I am new to N++.
    Thank you!

    C 1 Reply Last reply Mar 29, 2016, 9:47 PM Reply Quote 0
    • C
      Claudia Frank @Jim Biwer
      last edited by Mar 29, 2016, 9:47 PM

      Hello @Jim-Biwer,

      by using regular expressions and find/replace dialog.

      CTRL+H
      check regular expression (bottom left)

      find what:(.*)\r\n
      replace with:‘\1’,

      (.)\r\n = you are looking for text which end with CRLF
      (.
      ) = holds the text without the eol chars
      \1 = what (.*) returns
      encased by quote and added a comma as you’ve told.

      It results in ‘A’,‘B’,‘C’,‘D’, so you need to delete the last comma manually.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • J
        Jim Biwer
        last edited by Mar 30, 2016, 1:53 PM

        Thanks, I will give it a try.

        1 Reply Last reply Reply Quote 0
        • J
          Jim Biwer
          last edited by Mar 30, 2016, 3:24 PM

          Got it, works good. Thank you!

          1 Reply Last reply Reply Quote 0
          • J
            Jim Biwer
            last edited by Mar 30, 2016, 3:44 PM

            Yes, works great. Thank you.

            1 Reply Last reply Reply Quote 0
            • J
              Jim Biwer
              last edited by Mar 30, 2016, 4:13 PM

              In Ultra Edit, I would search for ^p and replace with ‘,’

              Thanks again. Solved.

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