1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Extract phone numbers from a chat history

Discussion in 'AI - Artificial Intelligence in Digital Marketing' started by soxtexo, Feb 14, 2018.

  1. soxtexo

    soxtexo Newbie

    Joined:
    Sep 13, 2017
    Messages:
    23
    Likes Received:
    3
    Gender:
    Male
    Hey guys,

    I've got a chat history from a WhatsApp group.

    The structure of the text looks like:

    ....
    05.12.17, 06:55:25: ‎‪+49 173 71696**‬ hat die Gruppe verlassen
    05.12.17, 06:56:25: ‪+49 176 642603**‬: Hast du noch einen guten ab 21 Uhr ?
    05.12.17, 06:57:04: ‪+49 176 706610**‬: Heute muss rasiert werden
    05.12.17, 06:57:25: ‪+49 1516 15348**‬: chillt
    ...

    Now I would like to extract all the numbers out of this txt. file
    I would like to get a list of numbers where every number is unique with no double numbers.

    Does anyone have an idea what's the easiest way to do this? :) Thanks you guys!
     
    • Thanks Thanks x 1
  2. bmbsa

    bmbsa Junior Member

    Joined:
    Jun 25, 2014
    Messages:
    120
    Likes Received:
    19
    I believe you can do this in less than 5 minutes using regex (notepad++ or any other text editor) to extract the numbers + excel to remove duplicates
     
  3. Builder Dave

    Builder Dave Junior Member

    Joined:
    Nov 4, 2017
    Messages:
    120
    Likes Received:
    54
    Gender:
    Male
    Yep, regular expression should do the job really quickly.
     
  4. Sudarshan Kar

    Sudarshan Kar Jr. VIP Jr. VIP

    Joined:
    Apr 27, 2017
    Messages:
    186
    Likes Received:
    68
    Gender:
    Male
    Occupation:
    Writer, Marketer.
    If you are familiar with programming, this should be a piece of cake.
     
  5. bitBot

    bitBot Newbie

    Joined:
    Apr 8, 2018
    Messages:
    8
    Likes Received:
    0
    Gender:
    Male
    Use something like "\+[0-9]{2} [0-9]{3,4} [0-9]{4}/g" in any regex editor
     
  6. kullaravi

    kullaravi Junior Member

    Joined:
    May 1, 2011
    Messages:
    103
    Likes Received:
    23
    Regex would be the easiest way to go..
     
  7. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    8,740
    Likes Received:
    9,774
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    If the data is formatted like that, you can split the lines into columns by the "+" and ":" delimiters in Excel, so you'll have the phone numbers in one column, what you can copy-paste to Notepad++ and use the TextFX plugin to remove duplicates.
     
  8. Melos

    Melos Junior Member

    Joined:
    Apr 22, 2018
    Messages:
    100
    Likes Received:
    37
    Gender:
    Male
  9. MunnyMachine

    MunnyMachine Registered Member

    Joined:
    Dec 8, 2015
    Messages:
    59
    Likes Received:
    5
    or Pay someone like 5 bucks to write a quick script
     
  10. pinkpower123

    pinkpower123 Jr. VIP Jr. VIP

    Joined:
    Mar 29, 2014
    Messages:
    104
    Likes Received:
    18
    What service?
     
  11. Innovative-SEO

    Innovative-SEO BANNED BANNED

    Joined:
    Apr 29, 2019
    Messages:
    19
    Likes Received:
    0
    Gender:
    Male
    I can do this. Contact me if you can.
     
  12. timothywcrane

    timothywcrane Power Member

    Joined:
    Apr 25, 2009
    Messages:
    694
    Likes Received:
    298
    Occupation:
    Internet Promotion Management
    Location:
    USA
    if you are looking to get into text and data manipulation, automation, or data vi... I recommend Python... check out split() function.