input conversion error for lines ending with space carriage return
Status: Beta
Brought to you by:
m_schellens
I'm fairly new to GDL and IDL (usually python or C) and I've run in to what I think is a bug. The following runs as expected in IDL, but not with GDL. I've gotten the problem down to this simple example with readf, but can't seem to recreate it with reads. The problem is when reading multi-line data from an ascii file using "readf" where lines are terminated with a space, carriage return, and newline; so ' \r\n'. The file comes from Windows and is being read on CentOS 6, GDL 0.9.5. If I use "fromdos" to remove the carriage return it works fine. If I remove the space it works fine.
pro test_read,file
openr,unit,file,/get_lun
data2 = fltarr(4,2)
readf,unit,data2
print,data2
end
0 -0.3360 1.000443 2.495156E-8 \r\n
1 14.6296 0.974881 -1.416588E-6 \r\n
% Input conversion error.
0.00000 -0.336000 1.00044 2.49516e-08
-1.00000 1.00000 14.6296 0.974881
0000000 0 - 0 . 3 3 6 0 1 . 0 0
0000020 0 4 4 3 2 . 4 9 5 1 5 6 E -
0000040 8 \r \n 1 1 4 . 6 2 9 6
0000060 0 . 9 7 4 8 8 1 - 1 . 4 1 6 5
0000100 8 8 E - 6 \r \n
0000110
Actually I got it down even further and with reads:
Last edit: David Hoese 2015-05-29
Moved here: https://github.com/gnudatalanguage/gdl/issues/215