We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello Every-one, first message here, I do need some help on that, I'm sure it's quite simple but I've been struggling a lot on that recently "grrrr" ~X(
I have a .DAT file witch comport a list of airport and coordonates of these.
Easy I want to "look for" a certain airport and gets its coordonates back.
The format of the file is :ZZZZCORDONATEX CORDONATEY
My problem is that sometimes I got 2 spaces in between values and then got a "shifting" and mess up my values(By the way I'm sure that is the problem). I don't have any more code since I didn't get it to work as its design :(|) :(|)
This file is quite big about 13k lines. here is an example of the file.
"CYGB 49.694167-124.517778
EDFU 49.695000 9.182000
LKMT 49.696111 18.110833
CJE3 49.697495-103.800722
ETIC 49.698686 11.940175
CEY3 49.700000-113.416667
CKJ7 49.706053 -97.680525
EGJA 49.706758 -2.214481
CYQQ 49.710833-124.886667
"
thanks for the help !
Flo
Answers
you could load with loadStrings
Then for loop over it and use replaceAll to replace duplicate spaces by Single spaces. Maybe repeat twice
Then you are good to go
for loop again over it and use split to break down the line
Maybe fill those data into an class Airport that is held by an ArrayList
Work with that then
Make a backup from your dat
Well works fine thanks a lot ! Great help down here :p