You are here: Re: Extrapolate from NMEA file « PHP Programming Language « IT news, forums, messages
Re: Extrapolate from NMEA file

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация