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

i need help splitting a txt file username:passsword format

Discussion in 'BlackHat Lounge' started by webwhizz, Oct 30, 2012.

  1. webwhizz

    webwhizz BANNED BANNED

    Joined:
    Apr 3, 2011
    Messages:
    724
    Likes Received:
    659
    Hi, i have a txt file in this format username:ppassword and i need to split it up, so that i have a notepad txt file with just usernames and one with passwords, does any of you clever bhw people know how i can do that?
    thanks
     
  2. shailzrocks

    shailzrocks Jr. Executive VIP Jr. VIP

    Joined:
    Jan 1, 2012
    Messages:
    1,132
    Likes Received:
    1,788
    Occupation:
    Dolphin Seller in a Black Market
    Location:
    No Man's Land
    Paste them in Excel

    Select the Column. Look for this option "Text to Column"

    Select delimited, then select others and write ":" (without qoutes)

    Ok and Finish :)
     
    • Thanks Thanks x 1
  3. ekoee

    ekoee Junior Member

    Joined:
    Jun 2, 2011
    Messages:
    123
    Likes Received:
    38
    Occupation:
    Web designer
    Location:
    London
    You can do this with excel.
     
  4. godmonkee

    godmonkee Regular Member

    Joined:
    Jan 12, 2009
    Messages:
    396
    Likes Received:
    769
    Occupation:
    IM
    Location:
    Gallifrey
    I can do that real quick if you cant manage it, send me a pm
     
  5. webwhizz

    webwhizz BANNED BANNED

    Joined:
    Apr 3, 2011
    Messages:
    724
    Likes Received:
    659
    Thanks for your advice my excel seems to be corrupt at mo, ive tried for a few hours with open office cal, hmm i need to finnd my windows office disc thanks
     
  6. Herion

    Herion Jr. VIP Jr. VIP

    Joined:
    Jul 8, 2012
    Messages:
    409
    Likes Received:
    100
    Quickly coded this in visual basic. Requires .NET Framework 4.0, splits using the delimiter ":", comes with the source if you want to make modifications or recompile.

    Code:
            Dim array As String() = RichTextBox1.Lines
            Dim arraycount As Integer = array.Length
            Dim i As Integer = 0
            Do While i <> arraycount
                Dim arr As String() = array(i).Split(":")
                RichTextBox2.Text += arr(0) & vbCrLf
                RichTextBox3.Text += arr(1) & vbCrLf
                i += 1
            Loop
    
     

    Attached Files:

    • Thanks Thanks x 1
  7. gullsinn

    gullsinn Elite Member

    Joined:
    Dec 24, 2009
    Messages:
    2,439
    Likes Received:
    2,258
    Gender:
    Male
    Occupation:
    Jobless :D
    Location:
    Graveyard
    Home Page:
    lol that's exactly how i do for Faris :)
     
  8. webwhizz

    webwhizz BANNED BANNED

    Joined:
    Apr 3, 2011
    Messages:
    724
    Likes Received:
    659
    Thanks for this, its amazing just what i needed :)

     
  9. GauravJ

    GauravJ Power Member

    Joined:
    Jul 25, 2012
    Messages:
    626
    Likes Received:
    207
    Occupation:
    Internet Marketer
    Location:
    Near you
    Home Page:
    Hi,
    why are you using macros when it can be done with simple excel formulas
    Try this, simple formulas
    Simply select cell A1, Then copy all data from notepad and paste it into excel

    Then click in cell C1 and type following formula =Len(A1)
    then click in cell D1 and type following formula =Search(":",A1)
    Now in cell E1 type =Left(A1,D1-1)
    and In cell F1 type =Right(A1,C1-D1)
    and Finally, Select cell E1 and F1 and drag them upto the bottom of the list
    and You will get desired results

    Hope,It solves your requirement.
    In case you face any problem,feel free to PM me.

    Thanks