#!/usr/bin/perl while(<>) { @stuff=split(' '); if(/UQMD/){ } elsif(/projectile:/){ $protar=$_ } elsif(/equation_of_state:/){ $ecm=$stuff[5]; $elab=$stuff[3]; $plab=$stuff[7]; } elsif(/event#/){ $noe++ # numbers of events: noe } else{ if($#stuff==14||$#stuff==13){ @x=@stuff[0..3]; @p=@stuff[4..7]; @id=@stuff[8..11]; $mass=$id[0]; $ityp=$id[1]; $iz2=$id[2]; $charge=$id[3]; # ab hier steht folgende info zur verfuegung: # stuff[0] = r_0 = $x[0] # stuff[1] = r_x = $x[1] # stuff[2] = r_y . # stuff[3] = r_z . # stuff[4] = p_0 = $p[0] # stuff[5] = p_x = $p[1] # stuff[6] = p_y . # stuff[7] = p_z . # stuff[8] = mass = $id[0] # stuff[9] = ityp = $id[1] # stuff[10]= iz2 = $id[2] # stuff[11]= charge = $id[3] # hier bestimm ich was ich suche if ($ityp==1){ open(file, ">sort.txt"); print file ("! ",$protar); print file ("!number/event:",$number/$noe," ,ev:",$noe,"\n"); foreach $i(0 .. $#n){ print file ($x[0],"",$x[1],"",$x[2],"",$x[3],"",$p[0],"",$p[1],"",$p[2],"",$p[3],"",$id[0],"",$id[1],"", $id[2],"", $id[3],"\n") } close(file);