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

Home » Public Forums » archive » Re: SPLIT numbers into sub-numbers
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: SPLIT numbers into sub-numbers [message #80587 is a reply to message #80584] Fri, 22 June 2012 18:45 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <js2mga$jh0$1@dont-email.me>, Michael Galloy <mgalloy@gmail.com>
wrote:

> On 6/22/12 1:52 PM, k_ghreep@yahoo.com wrote:
>> Dear all
>> I would like to split the following number 20100115 into year, month
>> and day
>> any suggestions
>> Thanks
>
> Something like this:
>
> IDL> ts = '20100115'
> IDL> year = long(strmid(ts, 0, 4))
> IDL> month = long(strmid(ts, 4, 2))
> IDL> day = long(strmid(ts, 6, 2))
> IDL> help, year, month, day
> YEAR LONG = 2010
> MONTH LONG = 1
> DAY LONG = 15

Or

year = 0
month = 0
day = 0
READS, ts, year, month, day, FORMAT = "(I4,2I2)"

Cheers, Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: astronomy library
Next Topic: Re: Coyote graphics resizeable window

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

Current Time: Wed Oct 08 15:28:43 PDT 2025

Total time taken to generate the page: 0.00441 seconds