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

How do I delete numbers. at front of txt document ?

Discussion in 'BlackHat Lounge' started by boro, Feb 2, 2011.

  1. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    As the title says how do I delete the numbers at the beginning of every line on a txt document
    as in
    1.
    2.
    3. and so on for a long way
    cheers
     
  2. ExtraWinner

    ExtraWinner BANNED BANNED

    Joined:
    Jun 18, 2010
    Messages:
    2,346
    Likes Received:
    3,463
    Notepad ++ will help.
     
    • Thanks Thanks x 1
  3. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    yes ive had a look but too many options for someone who doesnt know what to click
     
  4. ┼blackrat┼

    ┼blackrat┼ Senior Member

    Joined:
    Jul 31, 2010
    Messages:
    899
    Likes Received:
    729
    Location:
    Sewer
    try opening the txt as a .csv in excel, and make it so that the dot is the separator and then you get the 2nd column free of numbers. Never did this myself but just occurred.
     
    • Thanks Thanks x 1
  5. Amsele

    Amsele Newbie

    Joined:
    Jan 18, 2011
    Messages:
    4
    Likes Received:
    1
    Location:
    Europe
    Eventually you can import it, or open the txt in excel, tap seperatet option and delte the first column
     
    • Thanks Thanks x 1
  6. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    its a list of forum profiles so there are dots throughout each line tried opening it in excel before will give it another go
    thought I would try it myself before getting back onto fiver gig to get a list without numbers in it
     
  7. BugFixed

    BugFixed Junior Member

    Joined:
    Sep 24, 2010
    Messages:
    130
    Likes Received:
    39
    Using UltraEdit, just press Alt+C, select column block that you want to delete, then press Ctrl+X (Cut).

    Press Alt+C once again to return to row select mode.
     
    • Thanks Thanks x 1
  8. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    trying it now cheers
     
  9. IamNRE

    IamNRE Jr. VIP Jr. VIP Premium Member

    Joined:
    Aug 18, 2010
    Messages:
    4,663
    Likes Received:
    7,108
    Occupation:
    Generate Leads With FB Ads For Just $1
    Home Page:
    • Thanks Thanks x 1
  10. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    I must be missing something here how does adding something help me remove the numbers

    excel is not seeing it as 2 seperate columns only 1 so cant see how to delete it that way

    Thanks to everyone for their help but will get back on to seller
    for a list without numbers at the start after all I have paid a whopping $5


    just had a thought wonder if scrapebox will delete the numbers automatically from the beginning of the url

    cheers
     
  11. toddbiala

    toddbiala Newbie

    Joined:
    Jan 25, 2011
    Messages:
    31
    Likes Received:
    3
    you can do it in excel. Past your document in and you said it ends up in one column. then select that column and go to data then text to columns. Select delimited then go to step 2. in step 2 check the other tab then enter a period "." that should do the trick for you. it will put all the numbers in the first column and everything after the period in the next column.
     
    • Thanks Thanks x 1
  12. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    cheers nearly worked but unfortunately being forum profile urls they have many .s in each line so it split them all up and deleted .s maybe I pressed something wrong
    no problems though have been in contact with provider so hopefully will have a new list soon
     
  13. wkrappen91

    wkrappen91 Power Member

    Joined:
    Sep 9, 2010
    Messages:
    588
    Likes Received:
    720
    Location:
    127.0.0.1
    Code:
    <?php
    $oldfile = file("oldfile.txt");
    $newfile=fopen("newfile.txt","w+");
    $i=0;
    foreach($oldfile as $key => $value){
    $str= strpos($oldfile[$i],".");
    $newoldfile = substr($oldfile[$i],$str+1);
    fwrite($newfile,$newoldfile);
    $i++;
    }
    ?>
    here.
    tried it. works
    I hope you have xamp/wamp
    name the file you have now oldfile.txt and watch it generate newfile.txt

    Edit: Don't hate me for the quick and dirty script, im sure there is a better way but this one works too.
     
    • Thanks Thanks x 2
    Last edited: Feb 2, 2011
  14. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161
    Thanks for the effort
    but I managed it in excel played around with what toddbiya :biggthump said

    this worked for me

    Paste your document in and you said it ends up in one column. then select that column and go to data then text to columns. Select fixed width then move the line to where you want to split column
    had to do that twice
    but it worked took about 5 seconds in total
     
  15. Hijinx

    Hijinx Junior Member

    Joined:
    Apr 13, 2009
    Messages:
    142
    Likes Received:
    87
    Location:
    New Jersey
    You could open it in Notepad then click Edit, Replace... in the find box type in 0. leave the replace box empty and click on replace all. then do it again for 9., 8., 7. etc.
     
    • Thanks Thanks x 1
  16. wkrappen91

    wkrappen91 Power Member

    Joined:
    Sep 9, 2010
    Messages:
    588
    Likes Received:
    720
    Location:
    127.0.0.1
    but there will be numbers like 145. which will end up like: 14 if you do it your way..
     
  17. boro

    boro Regular Member Premium Member

    Joined:
    Aug 6, 2008
    Messages:
    264
    Likes Received:
    161

    Thanks but already posted how I managed it
    took about 5 seconds in total once you know which buttons to press
    I suppose I could have done it your way
    if I replaced 0. with .
    1. with .
    and so on but would have had to keep going through the numbers time and time again as the last number changed
    as in 93005.
    would become 9300.
    930.
    93.
    9.
    and then go through replacing single numbers dot with nothing

    thats the beauty of this forum people chip in with ideas even if not exactly what the op wants and eventually a solution is found
    even had someone pm me to do it for me
     
  18. bezopravin

    bezopravin BANNED BANNED

    Joined:
    May 11, 2010
    Messages:
    461
    Likes Received:
    3,471
    You can do it easily in Notepad++

    Look at this video :
    http://www.blackhatworld.com/blackhat-seo/2378886-post12.html
     
    • Thanks Thanks x 2
  19. wunzzz

    wunzzz Junior Member

    Joined:
    Feb 16, 2010
    Messages:
    131
    Likes Received:
    65
    Occupation:
    Professional Moneymaker
    Location:
    East Coast
    For anyone else who's trying to find an easier way, put everything into notepad++, select all and go to "TextFX" then tools and click "Delete Line Numbers or First Word". Tried this with numbers and semi colon's, hope this is useful to anyone else :)
     
  20. lazzerus9

    lazzerus9 Newbie

    Joined:
    Jan 29, 2011
    Messages:
    7
    Likes Received:
    2
    try it with excel, these things are much easier thank using simple notpad or notepad+++