Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to extract a certain text from lines with notepad?

    General Discussion
    3
    3
    2232
    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.
    • ani rodet
      ani rodet last edited by

      How are you friends ?, I hope that well, I hope you can help me I have a txt with 12678 lines and I need to separate
      the email with your address, the lines are like this
      email:addresss
      fami67@makil.com:avstree568 — -phonenumber 455678 number
      johon@yahoo.com:bernu34 4567ytru http://www.
      hasmnin@hotmail.com:californiaUD direction http://www. 5903
      .
      .
      .
      .

      The result I need is:

      fami67@makil.com:avstree568
      johon@yahoo.com:bernu34
      hasmnin@hotmail.com:californiaUD

      I await your prompt reply
      Thank you

      Scott Sumner 1 Reply Last reply Reply Quote 0
      • guy038
        guy038 last edited by guy038

        Hello, @ani-rodet,

        Please, before trying to " think regex ", anyone should get into the habit of expressing its problem, in natural language, first, taking into account all its data ;-))

        In your case, you want to : delete the ending part of each line, beginning with the first space character of that line

        Then, the regex equivalent is quite easy to find out !

        SEARCH (?-s)\h.+

        REPLACE Leave EMPTY

        Notes :

        • As usual, the (?-s) modifier means that the dot . will match a single standard character, only ( not EOL ones )

        • Then, \h matches any horizontal blank character ( the space char \x{0020}, the tabulation char ( \x{0009} and the no-break space character \x{00a0} )

        • The final part .+ matches any non-null range of standard characters, after the horizontal blank char, till the end of each line

        • As the data matched have to be deleted, the replacement zone must stay empty

        Best Regards

        guy038

        1 Reply Last reply Reply Quote 2
        • Scott Sumner
          Scott Sumner @ani rodet last edited by

          @ani-rodet

          This post looks very similar to this thread created by you. I think that if you post again with such questions, you should also show us WHAT YOU TRIED ON YOUR OWN before you posted. Otherwise it simply seems like the people supporting this Community are just doing your work for you (instead of giving you hints/help) and you should pay them for that help.

          And “I await your prompt reply” in such a context…is offensive.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors