Geetha Weerasooriya am Sonntag, 3. September 2006 16:22: > 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)
[please don't top post] Hm, I need still more info (and I hope others as well)... > 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 I see 9 labels (Date, Time, Veh ID, Longitude, Latitude, Speed, Odometer, Route No, distance flag), but 10 data fields (2003/11/12, 8:32:43, 10, 139.6368501, 35.51527949, 23.6, 27406416, 1, 2177, 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. Which data fields group the records from which you calculate the sequence? Are these the three fields Date / Veh ID / Route No ? (If a bus drives more than once a day: how to separate these drives?) Can the sequence also be something like 0,1,2,2,3,3,4 etc? (It seems from the first two records: same date, same Veh ID, same Route No) Is it correct that the group of records from which you calculate the sequence is ordered in the file, but can be intermixed with (also ordered) lines of other record groups? Is there a maximum number of records per group? > 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. So, you have these three cases, correct? - sequence 0..4 (into first file) - sequence 4..0 (into second file) - sequence 0..2 (discard) (whereby a sequence value can be repeated) > My problem is how to split this based on the flag I have already > attached. [...] Could you also post about 30 lines of sample data, without line breaks within the records, and eventually indicate which lines form a sequence? Dani -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>