I don't know how to ask this. I will try my best to make sense.
I have a text file with a 1,000 urls in it. I'm looking for software that
can rearrange them in a random order. This way they are all mixed up and
not the way they currently are. The urls must stay intact though. Just the
order in which they are listed needs to change.
It's just a text list of URLs? Something like this:
<a href="
http://www.yahoo.com/">Yahoo</a>
<a href="
http://www.google.com/">Google</a>
<a href="
http://www.altavista.com/">Altavista</a>
<a href="
http://www.obscurestore.com/">Obscure Store</a>
<a href="
http://www.adaily.com/">Arts and Letters Daily</a>
or this?:
http://www.yahoo.com
http://www.google.com
http://www.altavista.com
http://www.obscurestore.com
http://www.adaily.com
Copy the following and paste it into a text editor (Notepad will do, if
you're using Windows):
<html>
<head><title>URL Mixer</title>
<style type="text/css">
textarea {width:100%}
</style>
<script type="text/javascript">
flg=1;
function mixIt(){
if(flg){
flg=0;
var f=document.forms['frm1'];
var c=(typeof parseInt(f.elements['cnt'].value=='number'))?
f.elements['cnt'].value-1:4;
var t=f.elements['txt'];
var tx=t.value.replace(/^\s+/g,'').replace(/\s+
$/g,'').split('\n');
var r=tx.length;
var l=r-1;
do{
do{
var i=Math.floor(Math.random()*r)
var tmp=tx[l];
tx[l]=tx
tx=tmp;
}while(l-->0);
l=r-1;
}while(c-->0);
t.value=tx.join('\n');
flg=1;
}
}
</script>
</head>
<body>
<form name="frm1">
Shuffle <input name="cnt" type="text" size="1" maxlength="1"
value="5" /> times<br />
<textarea rows="20" name="txt"></textarea><br />
<input type="button" value="Shuffle" onclick="mixIt()" /> <input
type="button" value="Select All" onclick="document.forms
['frm1'].elements['txt'].select()" />
</form>
</body>
</html>
Save it with an '.html' or '.htm' extension, ie, 'shuffler.html' or
'urlmixer.htm'.
Open the new file in your browser, copy and paste your URLs into the
text box, and click Shuffle. Click Select All, right-click and copy out
the rearranged URLs.