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

Home » Public Forums » archive » Splitting An Array Of Strings Without Using Loops
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: Splitting An Array Of Strings Without Using Loops [message #35946 is a reply to message #35881] Mon, 28 July 2003 10:17 Go to previous messageGo to previous message
darrick.white is currently offline  darrick.white
Messages: 7
Registered: January 2003
Junior Member
> Dear Darrick,
>
> here is a second solution using reads.
>
> pro test
> data=['1:23','2:32','3:30','4:45']
>
> s={x:bytarr(1),s:bytarr(1),y:bytarr(2)}
> s=replicate(s,4)
>
> reads,byte(data),s
>
> print,string(s.x)
> print,string(s.y)
> end
>
> IDL> 1 2 3 4
> IDL> 23 32 30 45


It looks like I'm not explaining my problem clearly. For instance,
the following sets of data are valid inputs to my application:

1) data=['1:23','2:32','3:30','4:45']
2) data=['12:23','22:32:34:45','32:30','42:45:90']
3) data=['100:23','200:32','300:30','400:45']
4) data=['1:23:2','2:32:2','3:30:2','4:45:2']

The resulting transformation would like this for both:

1) print, intarr(2,4)
1 23
2 32
3 30
4 45

2) print, intarr(4,4)
12 23 NaN NaN
22 32 34 45
32 30 NaN NaN
42 45 90 NaN

3) print, intarr(2,4)
100 23
200 32
300 30
400 45

4) print, intarr(3,4)
1 23 2
2 32 2
3 30 2
4 45 2

Is there a way (not knowing what data set input is used) to transform
my data into the corresponding result array? Note: For
transformation #2 above, I need to append each point to my new array.
If the array dimensions don't match, I need to fill in those missing
elements with 'NaN'.

Thanks
-Darrick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: where is my plot....
Next Topic: Reading RINEX files into IDL

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

Current Time: Sun Oct 12 22:18:21 PDT 2025

Total time taken to generate the page: 2.71949 seconds