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 #80583 is a reply to message #80582] 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 22, 11:02 pm, 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
>
> Mike
> --
> Michael Galloywww.michaelgalloy.com
> Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
> Research Mathematician
> Tech-X Corporation

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 17:28:44 PDT 2025

Total time taken to generate the page: 0.00413 seconds