GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Anyone know of a program that will take a text file and randomize the lines? (https://gfy.com/showthread.php?t=640208)

Jace 08-01-2006 10:52 PM

Anyone know of a program that will take a text file and randomize the lines?
 
I have a huge list of urls, and I need them to be in random order...I have text pad, but that only sorts by letter and shit, and I need everything to randomize

is randomize even a word?

Quickdraw 08-01-2006 11:16 PM

If you can use PHP, here is quick dirty way to do it

PHP Code:

<?php
$file 
file("urls.txt");

// Strips dupes if you need, comment out if you do not need this
$temp array_unique($file);

//Shuffles the deck or randomizes :)
shuffle($temp);
//Prints each line 
foreach($temp as $value)
   {
   echo 
$value;
   }
exit;
?>


BIGTYMER 08-01-2006 11:19 PM

Quote:

Originally Posted by Quickdraw
If you can use PHP, here is quick dirty way to do it

PHP Code:

<?php
$file 
file("urls.txt");

// Strips dupes if you need, comment out if you do not need this
$temp array_unique($file);

//Shuffles the deck or randomizes :)
shuffle($temp);
//Prints each line 
foreach($temp as $value)
   {
   echo 
$value;
   }
exit;
?>


Cool little script. Thanks! :)

StickyGreen 08-01-2006 11:21 PM

gracias...

Jace 08-01-2006 11:22 PM

Quote:

Originally Posted by Quickdraw
If you can use PHP, here is quick dirty way to do it

PHP Code:

<?php
$file 
file("urls.txt");

// Strips dupes if you need, comment out if you do not need this
$temp array_unique($file);

//Shuffles the deck or randomizes :)
shuffle($temp);
//Prints each line 
foreach($temp as $value)
   {
   echo 
$value;
   }
exit;
?>


i did that and it output everything as one single line...LOL

worked great from what I can tell, but here is what it did


http://www.constantbabes.com/tmp/urls.php

mikeyddddd 08-01-2006 11:25 PM

Put a <br> on each line or change the script

From this:

echo $value;

to this:

echo "<br>$value";

or echo "$value<br>";

Quickdraw 08-01-2006 11:26 PM

Quote:

Originally Posted by Jace
i did that and it output everything as one single line...LOL

worked great from what I can tell, but here is what it did


http://www.constantbabes.com/tmp/urls.php

oh sorry--
You can save that page as a text file, or view source and it will be line by line

Jace 08-01-2006 11:29 PM

Quote:

Originally Posted by mikeyddddd
Put a <br> on each line or change the script

From this:

echo $value;

to this:

echo "<br>$value";

or echo "$value<br>";

PERFECT!

Jace 08-01-2006 11:30 PM

Quote:

Originally Posted by Quickdraw
oh sorry--
You can save that page as a text file, or view source and it will be line by line

I just added a BR to the end of each line and it worked fine

didn't think of saving it

regardless, it worked perfect :)

Quickdraw 08-01-2006 11:44 PM

Cool, glad it did what you needed.
And yes, randomizes is a real word.
http://www.thefreedictionary.com/randomize

potter 08-01-2006 11:58 PM

You can also use open office. Paste all the items into a spreadsheet, then paste the random number char code into the column next to the urls, then sort by numbered column, copy the column with the urls and you're done.


All times are GMT -7. The time now is 03:08 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123