How can I generate a batch of URLs?

Bill S July 24, 2013
Pinterest Stumbleupon Whatsapp

I want to generate a list of urls. I have the base url, but I want the numbering to be automatically changed.

For example:

http://www.plickheyt.com/pgfnsj/st1x001.jpg

In the above url “http://www.plickheyt.com/pgfnsj/st/” is the base. I want to find a way to automatically change the numbering.

http://www.plickheyt.com/pgfnsj/st1x001.jpg
http://www.plickheyt.com/pgfnsj/st2x001.jpg
http://www.plickheyt.com/pgfnsj/st3x001.jpg
http://www.plickheyt.com/pgfnsj/st4x001.jpg

I want each of the urls above to have 25 sets, like so:

http://www.plickheyt.com/pgfnsj/st1x001.jpg
http://www.plickheyt.com/pgfnsj/st1x002.jpg
http://www.plickheyt.com/pgfnsj/st1x003.jpg
http://www.plickheyt.com/pgfnsj/st1x004.jpg
http://www.plickheyt.com/pgfnsj/st1x005.jpg
. . .

http://www.plickheyt.com/pgfnsj/st2x001.jpg
http://www.plickheyt.com/pgfnsj/st2x002.jpg
http://www.plickheyt.com/pgfnsj/st2x003.jpg
http://www.plickheyt.com/pgfnsj/st2x004.jpg
http://www.plickheyt.com/pgfnsj/st2x005.jpg
. . .

How can I accomplish this? I have a freeware program called URLGen.exe, but it has limitations. It will not allow me to create 25 sets for each number.

Is there a batch script I could use? A Notepad++ trick?

Ads by Google

  1. Oron J
    July 25, 2013 at 11:05 am

    Well, there are lots of ways of doing this. Here's one:
    Open Excel (or any other spreadsheet)
    In A1, type the left part of the URL (the bit that goes before the number)
    In B1, type 1
    In C1, type the part of URL that goes after the number (i.e. .JPG)
    In D1, type =CONCAT(A1,B1,C1)
    The result of D1 should be the complete URL for the first page.

    Now fill columns A, C and D down to 25, then fill B down _as a series_ (using an increment of one). Column D will give you the 25 URLs. You can copy the results from there and paste them into notepad (or whatever).

    Now repeat the process for the other base addresses and you're done! You can do something similar in NotePad++ by starting with the numbers and using regular expressions to "wrap" them with the rest of the URL, but the easiest way to get a sequence of numbers is in a spreadsheet.

  2. Rob H
    July 25, 2013 at 10:45 am

    could you do something in excel like

    col1:http://www.plickheyt.com/pgfnsj/st
    col2: incrementing number
    col3: x00
    col4: incrementing number
    col5 .jpg
    col6: concatenate contents of cols1-5

    or use a little PHP script like:

    <?php
    $url="";
    for ($i = 1; $i <= 4; $i++) {
    for ($j = 1; $j <= 25; $j++) {
    $url="http://www.plickheyt.com/pgfnsj/st&quot;.$i."x00".$j.".jpg";
    echo $url;
    }
    }
    ?>

    need to get a bit smarter if you want
    http://www.plickheyt.com/pgfnsj/st1x025.jpg rather than http://www.plickheyt.com/pgfnsj/st1x0025.jpg