1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Extract User names from Text File

Discussion in 'Instagram' started by mike2468, Jan 19, 2015.

  1. mike2468

    mike2468 Registered Member

    Joined:
    Nov 8, 2011
    Messages:
    81
    Likes Received:
    2
    Is it possible to extract usernames from a text file and save in csv format or another text file? The text leading up to the file name is standard so there must be some way.

    Example:"from":{"username":"USERNAMEHERE","profile_picture":"https:\/\/igc

    I have pages and pages of this code so I'd like to avoid doing this by hand.
     
    Last edited: Jan 19, 2015
  2. stvmn

    stvmn Newbie

    Joined:
    Oct 25, 2008
    Messages:
    23
    Likes Received:
    10
    Easy...

    If your file consistently contains the text in your example you can easily create a comma delimited file by using the find replace function in notepad++ or your favorite text editor. As long as the text to the left and right of the unique username is consistent the method below will work. Otherwise you can use some Regular Expression terms for the find/replace.. but start here.

    Using your example:
    Replace the text to the left of your target.

    The exact text for the find function is within this bracket > ["from":{"username":"]
    Replace that text with a comma ,

    Run another find replace function to replace what is to the right of your target.
    The exact text for the 2nd find function is within this bracket > [","profile _picture"]
    Replace that text with a comma ,

    At the end of these two find/replace functions you should end up with text that looks like:
    ,USERNAMEHERE,:"https:\/\/igcblahblah
    ,USERNAMEHERE,:"https:\/\/igcblahblah
    ,USERNAMEHERE,:"https:\/\/igcblahblah
    ,USERNAMEHERE,:"https:\/\/igcblahblah

    Save as a .CSV file and open or import into Excel or Libre Office (Free spreadsheet) The Usernames will be all in one column.
     
    • Thanks Thanks x 2
  3. mike2468

    mike2468 Registered Member

    Joined:
    Nov 8, 2011
    Messages:
    81
    Likes Received:
    2
    stvmn- tried that, but the issue is that the text is not all the same before as it's from a web page. Just the same for about 15 characters before and 15 characters after.

    Appreciate the help though.
     
  4. alexandereast

    alexandereast Newbie

    Joined:
    Jan 20, 2015
    Messages:
    17
    Likes Received:
    0
    ohhhhhhh now i get it
     
  5. mike2468

    mike2468 Registered Member

    Joined:
    Nov 8, 2011
    Messages:
    81
    Likes Received:
    2
    Any ideas to solve this issue?
     
  6. mike2468

    mike2468 Registered Member

    Joined:
    Nov 8, 2011
    Messages:
    81
    Likes Received:
    2
    Still trying to fix this problem.
     
  7. therecipe

    therecipe Newbie

    Joined:
    Dec 18, 2014
    Messages:
    11
    Likes Received:
    3
    Code:
    [COLOR=#FFFFCC]{"username":"USERNAMEHERE","profile _picture":"https:\/\/igc[/COLOR]

    There are at least 3 different ways:


    1. You could decode it with json.

    2. You could scrap everything between
    Code:
    [COLOR=#FFFFCC]"username":"[/COLOR]
    and
    Code:
    [COLOR=#FFFFCC]","[/COLOR]
    3. You could use RegExp.


    But you will need some programming experience.
     
  8. akacash

    akacash Jr. VIP Jr. VIP

    Joined:
    Jan 16, 2010
    Messages:
    844
    Likes Received:
    622
    Location:
    The Beach, USA
    Copy it all to notepad, and use Find & Replace(F&R) to put a blank line directly before the username. So F&R:
    Code:
    "username":"
    with a blank space. That would turn
    Code:
    "from":{"username":"USERNAMEHERE","profile  _picture":"https:\/\/igc
    into
    Code:
    "from":{ USERNAMEHERE","profile  _picture":"https:\/\/igc
    Then at the end of it do this, F&R:
    Code:
    ","profile
    with @domain.com and a blank space, so your end result would give you this now:
    Code:
    "from":{ [email protected] _picture":"https:\/\/igc
    Once you have this, just get any old regular email extractor, and extract all of the usernames, then replace the fake domain at the end with nothing to remove it and wa-la :) Hope it helps.
     
  9. govindaraj

    govindaraj Power Member

    Joined:
    Aug 28, 2014
    Messages:
    591
    Likes Received:
    41
    Occupation:
    Social Marketing Account Creations
    Location:
    SALEM
    Home Page:
    very nice mate . . . . .
     
  10. ThreadKiller

    ThreadKiller Power Member

    Joined:
    Jan 31, 2012
    Messages:
    628
    Likes Received:
    307
    Location:
    Never too long in one place.
    UltraEdit is your friend. Probably the best text editor.