For anybody interested in this topic. I solved the prob with followin php
script:
$datei = "malaria_yellowfeewer.txt";
$line = file($datei);
for($x=0;$x<count($line);$x++){
for ($c=0;$c<count($country);$c++){
if (substr($country[$c],0,4) == substr($line[$x],0,4)){
echo $country[$c].$br;
/* yellow fewer
if (substr($line[$x+3],0,4)== 'Yell'){
$yellow_f = str_replace("Yellow fever: ", "",$line[$x+3]);
#insert into table
$stmt= "
UPDATE $DB2.countries
SET yellow_fever = '$yellow_f'
WHERE country = '$country[$c]'
";
$result = execute_stmt($stmt, $link);
###################
echo $yellow_f;
echo "<br>";
}
*/
// malaria
if (substr($line[$x+3],0,4)== 'Mala'){
$malaria = str_replace("Malaria: ", "",$line[$x+3]);
#insert into table
$stmt= "
UPDATE $DB2.countries
SET malaria = '$malaria'
WHERE country = '$country[$c]'
";
$result = execute_stmt($stmt, $link);
###################
echo $malaria;
echo "<br>";
}
if (substr($line[$x+2],0,4)== 'Mala'){
$malaria = str_replace("Malaria: ", "",$line[$x+2]);
#insert into table
$stmt= "
UPDATE $DB2.countries
SET malaria = '$malaria'
WHERE country = '$country[$c]'
";
$result = execute_stmt($stmt, $link);
###################
echo $malaria;
echo "<br>";
}
if (substr($line[$x+4],0,4)== 'Mala'){
$malaria = str_replace("Malaria: ", "",$line[$x+4]);
#insert into table
$stmt= "
UPDATE $DB2.countries
SET malaria = '$malaria'
WHERE country = '$country[$c]'
";
$result = execute_stmt($stmt, $link);
###################
echo $malaria;
echo "<br>";
}
}
}
}
Hope I could help somebody else
Andy
"Andy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I want to include some data into my website which covers malaria and
yellow
> feewer related to each country. On the WHO website are all the infos I
need.
> Their webmaster told me that unfortunatelly there is no db behind that and
> everything gos with html files. But I am free to extract that data.
>
> Well, I did create a txt file which looks more or less like that:
>
> ALGERIA
> Yellow fever: A yellow fever vaccination certificate is required from
> travellers over 1 year of age coming from infected areas.
> Malaria: Malaria risk is limited. One small focus (P. vivax) has been
> reported in Ihrir (Illizi Department), but this is isolated and access is
> difficult.
> Recommended prophylaxis: none.
>
> AMERICAN SAMOA
> Capital: Pago Pago
> Altitude: 10 m
> Yellow fever: A yellow fever vaccination certificate is required from
> travellers over 1 year of age coming from infected areas.
>
> Now I have a table in a MySQL db naming all those countries. The goal is
to
> extract the Yellow fever and Malaria line and put it into a mysql table
> related to the countries.
>
> I saw that PHP has some good functions on text, but do u guys think this
> could be done??? Doing it by hand could take allllloooong loooooong while.
>
> I am open for any idea!
>
> Thanx a lot for any help
>
> Cheers, Andy
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php