Community
    • Login

    HELP very new to this need help with lines please.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 425 Views 2 Watching
    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.
    • LoisL Offline
      Lois
      last edited by

      Hi I need help on how to do the below please.

      So I have a large document in this layout.

      2016-10-18 21:42:26 - Mum:

      New
      2016-10-18 21:48:19 - Lois:

      Ohhhh I like them ones
      2016-10-20 18:17:12 - Lois:

      Me too
      2016-10-20 21:11:59 - Lois:

      They look cool.

      But I need it to be like this so that the space between each line is removed and that the message follows on from the participants name. Its a very large document so I cant do this manually via each line. Thank you. An example below of how I need it to be.

      2016-10-18 21:42:26 - Mum: New
      2016-10-18 21:48:19 - Lois: Ohhhh I like them ones
      2016-10-20 18:17:12 - Lois: Me too
      2016-10-20 21:11:59 - Lois: They look cool

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        PeterJones @Lois
        last edited by PeterJones

        @Lois ,

        Based on what you said, I am designing a regular expression (fancy search) which looks for lines ending with a : , and collapse any newlines found immediately after that colon into a single space character.

        FIND WHAT = :\R+ (find a colon followed by one or more newlines)
        REPLACE WITH = :\x20 (replace with the colon and a space – \x20 is a regex way of writing a space that’s easy to copy/paste from the forum, but you could just use the colon character and space character when you are typing it in the REPLACE WITH box yourself)
        SEARCH MODE = Regular Expression
        REPLACE ALL

        BEFORE:

        2016-10-18 21:42:26 - Mum:
        
        New 
        2016-10-18 21:48:19 - Lois:
        
        Ohhhh I like them ones 
        2016-10-20 18:17:12 - Lois:
        
        Me too
        2016-10-20 21:11:59 - Lois:
        
        They look cool.
        

        AFTER:

        2016-10-18 21:42:26 - Mum: New 
        2016-10-18 21:48:19 - Lois: Ohhhh I like them ones 
        2016-10-20 18:17:12 - Lois: Me too
        2016-10-20 21:11:59 - Lois: They look cool.
        

        -—

        Useful References

        • Please Read Before Posting
        • Template for Search/Replace Questions
        • Formatting Forum Posts
        • Notepad++ Online User Manual: Searching/Regex
        • FAQ: Where to find other regular expressions (regex) documentation
        LoisL 1 Reply Last reply Reply Quote 1
        • LoisL Offline
          Lois @PeterJones
          last edited by

          @PeterJones this worked perfectly! Thank you very much

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors