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 #80584 is a reply to message #80583] Sat, 23 June 2012 11:59 Go to previous messageGo to previous message
k_ghreep is currently offline  k_ghreep
Messages: 19
Registered: May 2012
Junior Member
On Jun 23, 3:45 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article <js2mga$jh...@dont-email.me>, Michael Galloy <mgal...@gmail.com>
> wrote:
>
>
>
>
>
>
>
>
>
>> On 6/22/12 1:52 PM, k_ghr...@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

Thanks for your help
first you convert a long number to a string by put it between ' '

but if i have a long array like this
20100101 20100101 20100101 20100101 20100102
20100102 20100102 20100102 20100103 20100103
20100103 20100103 20100104

and I cann't put each sub group between ' '
how I can split this directly?
Best wishes
Khaled
[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 18:15:17 PDT 2025

Total time taken to generate the page: 0.00381 seconds