|
Posted by Sergej Andrejev on 11/05/05 02:13
cuba1@virgilio.it wrote:
> I must capture ONE line EVERY 10 LINES but only a block of 200 lines
> with the first columns begin with $GPGGA.
>
> I must to extrapolate the [column3] and the [column5]
> I must write new file with the rows like these:
I didn't realy understand what did you say but this is what could i
write from Ian B pseudo-code:
<?
$file1 = fopen("input.txt", "r");
$file2 = fopen("output.txt", "w");
// read every line (until EOF) and split it wiht space
while (($data = fgetcsv($file1, 1000, " ")) !== FALSE) {
if($data[0] == '$GPGGA'){
$row++;
}
if($row >= 10){
// Write output if got more than 10 lines
fwrite($file2, "Point($data[4],$data[2]\n");
}
}
fclose($file1);
fclose($file2);
?>
Navigation:
[Reply to this message]
|