• Login
Community
  • Login

copy all mobile numbers starting with 9

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
regexcopymobilenumbers
4 Posts 3 Posters 875 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.
  • A
    Amazon Books
    last edited by Amazon Books Jan 8, 2023, 3:53 AM Jan 8, 2023, 1:42 AM

    Hello, I have a text file containing entries like this (each on a separate line):
    1592-239300 / 232326, 94143059
    261180, 9416475681
    295511,
    , 9811885806
    and so forth.
    How to extract all mobile numbers from this file, that is, only those 10-digit numbers that start with the digit 9 ? That is, copy the highlighted results by notepad++ and paste them in another text file. With regex \d{10}, the results are highlighted, but not able to copy them and paste them elsewhere.
    Thanks.

    P 1 Reply Last reply Jan 8, 2023, 9:39 AM Reply Quote 0
    • P
      Paul Wormer @Amazon Books
      last edited by Jan 8, 2023, 9:39 AM

      @Amazon-Books An easy way to copy number to the clipboard is by the Python Script command editor.copyText(str(number)). But you need to install the PS plugin for that.

      1 Reply Last reply Reply Quote 0
      • G
        guy038
        last edited by guy038 Jan 8, 2023, 9:59 AM Jan 8, 2023, 9:56 AM

        Hello, @amazon-books, @paul-wormer and All,

        Really not difficult to achieve !

        • Open the Mark dialog ( Ctrl+ M )

        • SEARCH 9[0-9]{9}

        • Un-tick all options

        • Tick the Purge for each search and Wrap around box options

        • Select the Regular expression search mode

        • Click on the Mark All button

        • Click on the Copy Marked Text button

        • Open a new tab ( Ctrl + N )

        • Paste the marked text ( Ctrl + V )

        Here you are !

        Best Regards,

        guy038

        P 1 Reply Last reply Jan 8, 2023, 11:40 AM Reply Quote 1
        • P
          Paul Wormer @guy038
          last edited by Jan 8, 2023, 11:40 AM

          @guy038 Thank you. I always overlooked the button Copy Marked Text. Now I understand that it copies to the clipboard, good to know!

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