Frederik Ramm schreef: > Hi > > Marc Coevoet wrote: >> 004E4800,47N2000 >> 002W2300,57N0000 >> 001W0547,51N4823 >> 013E2600,47N3400 >> 013E2600,47N3400 >> 013E2600,47N3400 >> 013E2600,47N3400 >> 013E2500,47N3343 >> >> to something where 001W0547 becomes -1.0547 > > That can actually be done with sed on the Unix command line: > > % sed -e "s/\\([0-9]*\\)[WS]/-\\1./g; s/[EN]/./g; s/^0*//g; s/;0*//g; > s/-0*/-/g" < input.txt > output.txt > > But do check your input data to find out whether the stuff after the > letter is really fractions of degrees (if you find that you never have > the digits 6-9 following one of the letters but only 0-5 then that > would indicate you're dealing with minutes and seconds, which would > render above conversion invalid). > > Bye > Frederik >
Nice, I was thinking about looking for my shell prog book, and trying awk & some manips on the degrees and minutes, as there is no number > 59 .... A larger sample: 005E5536,49N2426 006E0058,49N1948 005E5434,48N3934 006E0724,48N3948 006E0847,48N4638 006E0618,49N2150 006E1340,49N0523 006E0644,48N4140 005E5134,49N2738 006E1035,49N2034 006E0615,49N1839 006E0643,49N0210 006E0226,48N4131 006E1032,49N1202 006E0635,48N5533 006E0529,48N5140 005E4447,49N3102 006E0939,49N0650 006E0639,49N2421 006E1018,49N1700 009E2700,55N0200 009E2300,54N5900 009E4846,57N0925 009E4500,57N1100 009E4846,57N0925 006E1435,50N4644 006E1435,50N4644 006E1435,50N4644 006E1435,50N4644 006E1435,50N4644 006E1435,50N4644 006E0237,50N4446 006E0236,50N4444 006E0447,50N4707 006E0413,50N4717 017E0406,59N1336 014E5500,55N0500 -- Shortwave transmissions in English, Francais, Deutsch, Suid-Afrikaans, Urdu, Cantonese, Greek, Spanish, Portuguese, ... http://users.fulladsl.be/spb13810/radio/swlist/ Stations list: http://users.fulladsl.be/spb13810/radio/txlist/ _______________________________________________ talk mailing list [email protected] http://lists.openstreetmap.org/listinfo/talk

