chayanvinayak
10-09-2007, 01:48 AM
hi,
i am writing xyz position of a particle for each frame(1-100) in text file and i am writing "new line" character after every frame so xyz values goes to new line.
but when it writes values to file, "\n" is neglected.
code ----------------------------------------
for($i=$initial_frame;$i<=$final_frame;$i++){// ------- this loop is for reading info
of one particle in all frames
currentTime $i;
float $temp[] = `getParticleAttr -at position particleShape1.pt[$n]`;
string $one_particle_one_frames = $temp[0]+" "+$temp[1]+" "+$temp[2]+"\n";
$one_particle_all_frames[$n] =$one_particle_all_frames[$n] + $one_particle_one_frames;
}
fprint $fileid $one_particle_all_frames[$n];
/----------------------------------------------------
but when it writes, all the values come in same line
kindly suggest
Thanks
i am writing xyz position of a particle for each frame(1-100) in text file and i am writing "new line" character after every frame so xyz values goes to new line.
but when it writes values to file, "\n" is neglected.
code ----------------------------------------
for($i=$initial_frame;$i<=$final_frame;$i++){// ------- this loop is for reading info
of one particle in all frames
currentTime $i;
float $temp[] = `getParticleAttr -at position particleShape1.pt[$n]`;
string $one_particle_one_frames = $temp[0]+" "+$temp[1]+" "+$temp[2]+"\n";
$one_particle_all_frames[$n] =$one_particle_all_frames[$n] + $one_particle_one_frames;
}
fprint $fileid $one_particle_all_frames[$n];
/----------------------------------------------------
but when it writes, all the values come in same line
kindly suggest
Thanks
