Dear Mr.Dani,

Thank you very much for the reply. I understand that but question is not
clear. I will explain my problem little more.

Below is the sample of my data set. Actual data file is very much
larger.( about 3 GB)

                                                                        
Date        Time  Veh ID        Longitude       Latitude Speed Odometer
Route No
distance flag
 2003/11/12     8:32:43 10      139.6368501     35.51527949     23.6
27406416 1      2177    3
 2003/11/12     8:32:44 10      139.6368501     35.51527949     23.6
27406416 1      2177    3
 2003/11/12     8:32:45 10      139.636606      35.51526727     27.6
27406436 1      2155    3

The Points A,B and C are defined.  In other words, the coordinates of
these points are known.

I tried to attach a flag depending on the distance to the bus  from the
origin of the route as follows:

if the distance from origin  is 0 to 50, 0
if it is 50 to 2000, 1 
if it is 2000 to 2070, 2 
if it is 2070 to 5775 , 3
if  5775 to 5830 flag is 4.

Point A(origin) lies between 0-50
Point B(destination) lies between 5775-5830
Point C(turning to other route) lies between 2000-2070 

If bus has gone from origin to destination we get a series of 0,1,2,3
and 4. 
If bus is coming other direction, sequence is 4,3,2,1 and 0. I want to
separate these two data into two files. If it has turned at point C we
get sequence of 0,1 and 2 only. This data I don't need.

My problem is how to split this based on the flag I have already
attached.

Please apologize me for the long mail.

Kind regards,

Geetha

-----Original Message-----
From: D. Bolliger [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 03, 2006 7:11 PM
To: beginners@perl.org
Subject: Re: Removing unnecessary data

Geetha Weerasooriya am Sonntag, 3. September 2006 08:19:
> Hi Dear all,

Hi Geetha Weerasooriya

> I have a data file for bus trajectories where bus location at each
> second along the route is given. The specified route for the bus is
from
> origin (Point A) to Destination (Point B) , but sometimes bus has
> changed the route at  a point (Point C) in between A and B and has
gone
> in some other route.   I want to remove these data lines relevant to A
> to C when the bus changes the route. In other words, I want to keep
only
> the data where bus had completed the trajectory from Point A to B.
>
> Can some one please help me? I am still new to perl.

It shurely can be done with perl, but I think you have to provide more
info so 
somebody can help:

How does the data look and what's its meaning? (How can the points A/B/C
be 
identified?)
What did you try so far?

Dani

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to