So far, any of the solutions I'm finding will only randomly place one fragment in an area rather than shuffling the data.
An example with 3 .txt files:
<table><tr><td>
1.txt
</td></tr></table>
<table><tr><td>
2.txt
</td></tr></table>
<table><tr><td>
3.txt
</td></tr></table>
if reloaded:
<table><tr><td>
3.txt
</td></tr></table>
<table><tr><td>
1.txt
</td></tr></table>
<table><tr><td>
2.txt
</td></tr></table>
etc.
Any ideas would be wondful. If programming is needed would consider offers.
Thanks
With an XSLT processor you might use a date:time function as seed but as yet this isn't avaliable in the basic IE processor for XSLT.
What follows links an XSL transform to the input xml file which holds filenames and then sorts the filenames using what appears to be a psuedo-random function suggested here [xslt.com].
Save the files in the same directory and throw the xml file into IE to see the end result.
File random.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="randomOutput.xsl"?>
<files>
<filename>somefilea1.txt</filename>
<filename>asaaa2.txt</filename>
<filename>ascftsw3.txt</filename>
</files> File randomOutput.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="seed">3</xsl:variable>
<html>
<body>
<xsl:for-each select="files/filename">
<xsl:sort select="substring(substring-after($seed div (position() * string-length()), '.'),2, 3)" data-type="number" />
<table><tr><td>
<xsl:value-of select="."/>
</td></tr></table>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="text()¦@*">
</xsl:template>
</xsl:stylesheet> I don't know whether there is a better initial seed value than 3.
The downside to not having a dynamic seed is that you get the same result until the input is changed again. This especially might not work well if your filenames are very similar.
It might be possible to add a PHP script to insert an ~truely random initial seed value, instead of '3', but then it may be simpler to do the whole thing in Perl or PHP, I don't know.
HTH
my $total_file_num = 3;
my $ret = "";
for ($i=1; $i<=$total_file_num; $i++) {
$files{$i} = 1;
}
while (scalar(keys %files) > 0) {
$file_num = int(rand $total_file_num);
@file_names = keys %files;
open (F, $file_names[$file_num] . '.txt');
while (<F>) {
$ret .= $_;
}
close (F);
delete $files{$file_names[$file_num]};
$total_file_num--;
}
print $ret;