Hi Nochmal,
okey... wie ich sehe braucht ihr doch den Quellcode... dann will ich euch mal die bearbeitungssub hier posten...
sub manipulation
{
@topicsystem = ("");
@topicinhaltsystem = ("");
Hier werden nur die Topics abgearbeitet... da diese aber eh alle in einer Datei stehen ist es egal (hier tritt der Fehler eben noch nicht auf
for ($i = $#data; $i >= 0; $i--)
{
($topic, $numt, $others) = split(//,$data[$i]);
chop $others;
push (@topicsystem, "$FORM{$i}$numt$others");
open (FILE,">test.txt");
foreach $line(@topicsystem)
{
if ($line ne "")
{
print FILE "$line\n";
}
}
close(FILE);
So, bis hierher wurden die Topics abgehandelt... nun wird für jedes Topic das es gibt die jeweilige Topic .txt file geöffnet. Anhand von $numt wird bestimmt welche Datei eben geöffnet werden muss.##
open(FILE, "$data_path/ch$numt.txt");
@choices = <FILE>;
close(FILE);
for ($j = $#choices; $j >= 0; $j--)
{
($name, $votes, $pos) = split(//,$choices
[$j]);
$name = "$i". "X$j";
$votes = "$i". "Y$j";
chop $pos;
push (@topicinhaltsystem, "$FORM{$votes}$FORM{$name}$pos");
hier habe ich mir zur kontroll $i anzeigen lassen... das ist die Variable die so aussieht wie ich es beschrieben hab, als 111110000333555 etc...##
print $i;
Dieser Teil sortiert die Eintragungen dann noch nach Stimmenzahl des Votingsystems...##
@topicinhaltsystem = reverse @topicinhaltsystem;
open(TEMPX, ">$data_path/temp$numt.db");
foreach $line2 (@topicinhaltsystem)
{
if ($line2 ne "")
{
print TEMPX "$line2\n";
}
}
close(TEMPX);
open(TEMP2, "<$data\_path/temp$numt.db");
@temps = <TEMP2>;
close(TEMP2);
@temps = sort NummernSort @temps;
@temps = reverse @temps;
open(FILE, ">$data\_path/testch$numt.txt");
foreach $tempval (@temps)
{
($votes, $topic, $num) = split(//, $tempval);
print FILE "$topic$votes$num";
}
close(FILE);
unlink ("$data\_path/temp$numt.db");
}
}
}
Sodale... ist etwas kompliziert... aber es funktioniert soweit ja ganz gut... nur eben das Problem mit den Mehrfacheinträgen bei den Files...
CU Quitschi