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

Home » Public Forums » archive » READF: Input conversion error.
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: Input conversion error. [message #91313 is a reply to message #91312] Mon, 29 June 2015 08:44 Go to previous messageGo to previous message
Priyadarsini Sivaraj is currently offline  Priyadarsini Sivaraj
Messages: 15
Registered: June 2015
Junior Member
On Monday, 29 June 2015 11:41:32 UTC-4, Priyadarsini Sivaraj wrote:
> Hello Everyone..
>
> I have 15 simple ASCII files, which have to be read and the details of it are to be stored in a structure called ROI. The fields of the structure are,
> NumROI-vector
> Name-String
> Color- 3 element vector
> NumPoints-integer
> Records-integer
> Points- Two dimensional vector.
>
> I tried reading them all in a loop by using,
>
> FOR i=1,15 DO BEGIN
> filename=[str,STRTRIM(i,2),ext]
> file=[filelocation,filename]
> Trial_ROI_Read,file
>
> In the procedure, I tried doing this,
>
> PRO Trial_ROI_Read, file
>
>
> p =MAKE_ARRAY(5,198,value=1)
> ROIs = CREATE_STRUCT('NumROI',[1],'Name','a','Color','1,1,1','NumPo ints',[1],'Records',[1],'Points',p[*,*])
> OPENR, lun1,file, /GET_LUN
> header = STRARR(12)
> READF, lun1, header
> ROIs.NumROI=STRMID(header(3),18)
> ROIs.Name=STRMID(header(9),12)
> ROIs.NumPoints=STRMID(header(11),13)
> ROIs.Color=STRMID(header(10),17)
>
>
> points = [id , x, y, lat, lon]
> WHILE ~EOF(lun1) DO BEGIN
>
> READF, lun1, id, x, y, lat, lon
> pt = [id,x,y,lat,lon]
> ;print, pt
> points = [points , pt]
>
> ENDWHILE
>
> points= REFORM(points , [ 5 , 198 ])
>
> But I am not able to open the file and the following error pops up:
> OPENR: Expression must be a scalar or 1 element array in this context: FILENAME.
>
> Is there any efficient way to do this..??Please do help me out..I am not well versed with IDL.

Sry..The subject is OPENR: Expression must be a scalar or 1 element array in this context: FILENAME.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cw_form widget offset
Next Topic: READ, adn get data into an array from LARGE SIZE FILES

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

Current Time: Wed Oct 08 19:04:48 PDT 2025

Total time taken to generate the page: 0.00459 seconds