gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
277 stars 61 forks source link

input conversion reading string (or files?) with windows-style line ends ("\r\n") #215

Open slayoo opened 6 years ago

slayoo commented 6 years ago

As reported by @davidh-ssec on SF.net (https://sourceforge.net/p/gnudatalanguage/bugs/651/):

IDL> data2 = fltarr(1,2)
IDL> s2 = '5 ' + string([13B, 10B]) + '5 ' + string([13B, 10B])
IDL> reads,s2,data2
IDL> print,data2
      5.00000
      5.00000
GDL> data2 = fltarr(1,2)
GDL> s2 = '5 ' + string([13B, 10B]) + '5 ' + string([13B, 10B])
GDL> reads,s2,data2
% Input conversion error.
GDL> print,data2
      5.00000
     -1.00000
GillesDuvert commented 6 years ago

title changed. conversion is OK if lines end with \n only. We should in this case ignore \r (rather, more generally, a predefined set of line ending characters).