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

Home » Public Forums » archive » Re: Readf and line lenght limit
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: Readf and line lenght limit [message #917] Fri, 19 March 1993 02:54 Go to previous message
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
In article LG5@news.cis.umn.edu, patel@euler.ee.umn.edu (Maqbool Patel) writes:
> I am reading a file with the following line
>
> while (not eof(lun)) do begin
> if(temp eq 'nt') then readf,lun,nnt
> print,ni
> end
>
> I get an error message like:
>
> % Input line is too long for input buffer of 2048 characters.
> % READF: Error encountered reading from file. Unit: 119
> File: /home/users/patel/csi_data/fw2dcsi.fid/procpar
> % Execution halted at READPROCPAR <read_procapr.pro( 54)> (READF).
> % Called from $MAIN$
>
> ...

Try to read in the file as a byte-array:

; (assume file contains 3 lines:
; 1st with one char. \
; 2nd with 2001 char.s + <cr>
; 3rd with 4002 char.sp / )

openr, unit, file, /get_lun ; open, get filesize, read, close
f_info = fstat(unit)
i = assoc(unit,bytarr(f_info.size))
byte_text = i(0)
free_lun, unit

help,byte_text
BYTE_TEXT BYTE = Array(6007)

pos = where(byte_text eq 10b) ; find carriage-returns: <cr> = 10b
help, pos
POS LONG = Array(3)
print, pos
1 2003 6006

t1=string(byte_text(0:1)) ; re-arrange, convert to string
t2=string(byte_text(2:2003))
t3=string(byte_text(2004:6006))
print, strlen(t1), strlen(t2), strlen(t3)
2 2002 4003


There may be a more sophisticated way, but this works (in Pv~Wave).

K.Knipp
__ ____ __
/ // _ \ / / Karlheinz Knipp Tel. 0511 - 762 4922
/ // /_/ // / Uni Hannover Fax. 0511 - 762 2483
/ // ____// / Institut fuer Photogrammetrie
/ // / / / Nienburger Str.1 email knipp@ipi.uni-hannover.de
/_//_/ /_/ FRG 3000 Hannover 1
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Multiple image plots in postscript
Next Topic: CALL FOR PRESENTATIONS: Navy SciViz/VR Seminar

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

Current Time: Wed Oct 08 19:34:07 PDT 2025

Total time taken to generate the page: 0.00439 seconds