| 查看: 2674 | 回复: 0 | |||
[求助]
IDL中读*.prv文件出现的错误:READF: End of file encountered. Unit: 101,
|
|
各位大侠: 您们好! 用IDL读*.prv 文件,出现的错误:READF: End of file encountered. Unit: 101, File: G:“book.txt” 代码如下:if file_test(txtname)then begin;The FILE_TEST function checks files for existence and other attributes without having to first open the file/用来检查文件是否存在及在不打开文件的情况下检查其属性 nLines=file_lines(txtname);file_lines()用于返回数据的行 tmp=" ";定义一个字符串变量 openr,lun,txtname,/get_lun ; 打开文件 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; while(~EOF(lun))do begin; readf,lun,tmp;读取第一行 ; print,tmp ; help,tmp Col=strsplit(tmp,/extract);拆分第一行获取列数 ColNum=N_elements(Col) Arr_1=dblarr(ColNum,nLines-1);定义一个n列n-1行,元素为0的数组 ;point_lun,lun,2 readf,lun, Arr_1 ;READF requires a file unit to be explicitly specified---明确指定文件单元 Arr_1=[[Col],[ Arr_1]];重新组合数组(n,n-1)+第一行=(n,n) endwhile print, Arr_1[*,1:*] free_lun,lun ;; Close the file and free the file unit endif 继续您的指导,谢谢! |
» 猜你喜欢
河南大学纳米科学与材料工程学院2025年科研人员招聘启事
已经有0人回复
江苏科技大学2025年招聘公告
已经有4人回复
地质学论文润色/翻译怎么收费?
已经有150人回复
中国科学院华南植物园2025年各类人才招聘宣公告
已经有3人回复
ACS期刊投稿快要正式接受了,副主编提出引用已发表图片或数据引用的书面许可,求助!
已经有11人回复
香港中文大学(深圳)2025年招聘简章
已经有2人回复














回复此楼