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

Very simple BAT file to randomise lines in a file - useful when scraping and so on

Discussion in 'Black Hat SEO Tools' started by davids355, May 20, 2014.

  1. davids355

    davids355 Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 25, 2011
    Messages:
    8,802
    Likes Received:
    6,371
    Home Page:
    I found this really useful so I thought I would post it - its just a BAT file that will randomise the lines in a list - if you are building lists for scraping and so on, its useful to be able to randomise them, and that gets quite difficult when you are working with really large files.

    On my VPS this does about 6000 lines per minute.

    Code:
    @echo off
    setlocal
    for /f "delims=" %%a in (list.txt) do call set "$$%%random%%=%%a"
    (for /f "tokens=1,* delims==" %%a in ('set $$') do echo(%%b)>random-list.txt
    endlocal
    
    To use it, just make your unsorted list called list.txt, then save the above code in a file called randomise.bat in the same directory - if saving from notepad, include the entire name and extension inside quotation marks, otherwise it will append with txt extension.

    Run the file and your randomised list will be outputed as list-random.txt.
     
    • Thanks Thanks x 1
  2. davids355

    davids355 Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 25, 2011
    Messages:
    8,802
    Likes Received:
    6,371
    Home Page:
    Just realised, you can do most of it more easily with the remove duplicates addon for scrapebox:)