Community
    • Login

    HELP very new to this need help with lines please.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 21 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.
    • LoisL
      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
        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
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors