| 查看: 2673 | 回复: 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 继续您的指导,谢谢! |
» 猜你喜欢
工业工程与管理 求调剂 176 有学上就行
已经有1人回复
地质学298求调剂
已经有1人回复
地质学论文润色/翻译怎么收费?
已经有113人回复
326调剂帖
已经有1人回复
青C最后一年,散金祈福吧
已经有48人回复
没中,有点难受,科研也许就到这了,回归生活吧
已经有15人回复













回复此楼