comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Formatting strings to coordinates
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Formatting strings to coordinates [message #20138] Fri, 19 May 2000 00:00 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Simon de Vet wrote:
>
> The data analysis adventure continues... I have read in the data, and am
> now working on the various plots.
>
> I have a string array, taken from the text file, of coordinates.
> However, they are in the form "43.92�S" ,and "176.50�W".

Off the top of my head, I can think of two ways:

1) The STR_SEP method where the degree symbol, �, is the separator. The
first element of the result is then just the number in string form. By
using FLOAT, you'll have a real number. (However, I don't know how to
represent the symbol � in the command....ASCII escape sequence or
something like that?)

2) Lopping off the last two characters manually, e.g.:

c_lat = "43.92�S"
len = STRLEN( STRTRIM( c_lat, 2 ) ) ; Make sure there are no " " at
the end
c_lat = STRMID( c_lat, 0, len - 2 )
lat = FLOAT( c_lat )

I do this sort of thing all the time reading in radiosonde data

good luck

paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
[Message index]
 
Read Message
Read Message
Previous Topic: Re: returning values from widget hierarchy
Next Topic: returning values from widget hierarchy

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:51:02 PDT 2025

Total time taken to generate the page: 2.51429 seconds