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

Home » Public Forums » archive » Input line too long???
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: Input line too long??? [message #20753 is a reply to message #20682] Thu, 20 July 2000 00:00 Go to previous messageGo to previous message
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
David Bowman wrote:
>
> [[ This message was both posted and mailed: see
> the "To," "Cc," and "Newsgroups" headers for details. ]]
>
> Pavel,
> Thanks, that worked like a charm! Is there any way of doing the
> same operation when the records are not all of the same length? Just
> curious.

David,
I tried to play with different byte lengths per record and it seems
pretty simple, as long as you know when the record length changes and
those changes are repetitive. Then, you could read the long string in
increments, like this:

;if a string is like:
;.1111 .2222 .3333 .4444 .55 .66 .1111 .2222 .3333 .4444 .55 .66 ... etc,

;then
x = strarr(4)
x[*] = '123456' ; 6-byte field, 4 of them
y = ['1234', '1234'] ; 4-byte field, 2 of them

while not EOF(unit) do begin
readu, unit, x
readu, unit, y
; Reassign X and Y to permanent array(s) to take them out of the loop
endwhile

If varying field lengths were not regularly distributed in the string,
I'd probably just open that file in a word processor and save it as text
with line breaks, then read formatted (READF) as floating point values.
Good solution for a lazy IDLer :-)
Cheers,
Pavel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: keyword issue (top 10 IDL request?)
Next Topic: pointers in IDL and C

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

Current Time: Sat Oct 11 14:57:59 PDT 2025

Total time taken to generate the page: 0.31948 seconds