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

Home » Public Forums » archive » strsplit vectorized
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: strsplit vectorized [message #85837 is a reply to message #85836] Thu, 12 September 2013 12:50 Go to previous messageGo to previous message
John Correira is currently offline  John Correira
Messages: 25
Registered: August 2011
Junior Member
On 09/12/2013 03:43 PM, spluque@gmail.com wrote:
> An update after finding out that IDL >= 8.0 does allow arrays as input...
>

>
> On Thursday, September 12, 2013 2:33:54 PM UTC-5, spl...@gmail.com
> wrote:
>> Hi,
>>
>>
>>
>> I realize that strsplit() only takes a scalar for its first
>> argument
string. I would like to have that operation done on all the elements of
a string vector. The vector contains time stamps (e.g. '2013-09-10
00:00:00'), that I am trying to replace by the concatenation of each
component (e.g. '20130910000000' in the preceding example). How can this
be done without a complicated loop?
>>
>>
>>
>> Thanks,
>>
>> Seb


For a IDL 7 compatible answer, if the data always in that format (i.e.
YYYY-MM-DD HH:MM:SS) you could do something like

new = STRJOIN(strmid(array,[0,5,8,11,14,17],[4,2,2,2,2,2]))

John
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Inverse hyperbolics?
Next Topic: generating sequences

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

Current Time: Fri Oct 10 13:34:24 PDT 2025

Total time taken to generate the page: 7.27815 seconds