RE: [PHP-DB] Difficulty on how to extract data out of a text withstring functions.

2002-03-06 Thread Gurhan Ozen

Yeah it is getting really off the topic i will email you in private.. :)

Gurhan
-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 3:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Difficulty on how to extract data out of a text
with string functions.


Hello Gurhan,

thanx for your help. You are right, the file is not consistent. But some
things are. For example that every line contains

one data set and that every line begins with the name of the column I would
like to have followed by a :

I could yous win32, linux rh72 and osx to do this. The question is what
would be the fastest way.

I never heared of unix shell scripting, but I asume it is something what
youwould call a batch file in win or apple script on mac.

Thanx again for your help.

Andy


"Gurhan Ozen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Andy,
> The little snippet you showed from the text file made me think that the
data
> layout for each  country is not consistent.
> For example:
> For Algeria there is the country name and right underneath goes the info
> about yellow fever and malaria as opposed to American Samoa where
underneath
> the country name is capital and altitude.. IS this the case? If it is, can
> you reorganize the data to be consistent and even same number of lines for
> each country? IT will make you life heck a lot easier to have a pretty
> consistent data layout to do what you need to do...
>  In addition, can you tell us what OS yo are using? I don't know if PH is
> the best and/or right choice to do this, but if you are in *NIX shell
> scripting can be useful.
>   Thanks..
>
> Gurhan
>
> -Original Message-
> From: Andy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 06, 2002 1:50 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-DB] Difficulty on how to extract data out of a text with
> string functions.
>
>
> 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 alng loong while.
>
> I am open for any idea!
>
> Thanx a lot for any help
>
> Cheers, Andy
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Difficulty on how to extract data out of a text withstring functions.

2002-03-06 Thread Gurhan Ozen

Hi Andy,
The little snippet you showed from the text file made me think that the data
layout for each  country is not consistent.
For example:
For Algeria there is the country name and right underneath goes the info
about yellow fever and malaria as opposed to American Samoa where underneath
the country name is capital and altitude.. IS this the case? If it is, can
you reorganize the data to be consistent and even same number of lines for
each country? IT will make you life heck a lot easier to have a pretty
consistent data layout to do what you need to do...
 In addition, can you tell us what OS yo are using? I don't know if PH is
the best and/or right choice to do this, but if you are in *NIX shell
scripting can be useful.
  Thanks..

Gurhan

-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 1:50 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Difficulty on how to extract data out of a text with
string functions.


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 alng loong while.

I am open for any idea!

Thanx a lot for any help

Cheers, Andy



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php