From bug-request at octave dot org Wed Dec 7 18:03:56 2005 Subject: Re: str2num.m can't handle LF character. From: Paul Kienzle To: "John W. Eaton" Cc: bug at octave dot org, Bill Denney , "Frederick (Rick) A Niles" Date: Wed, 7 Dec 2005 19:02:39 -0500 On Dec 7, 2005, at 3:38 PM, John W. Eaton wrote: > On 7-Dec-2005, Bill Denney wrote: > > | I don't think that this is actually an error. str2num should just > convert > | strings to numbers. If you give it a string that is not strictly > numeric > | (including all numeric notation such as 1e5-3j), it is supposed to > return > | empty. > | > | The problem sounds like it is with how your file is being read. > > I agree that it would be best if everyone would translate text files > appropriately. Then Octave would only have to handle '\n' as the > newline character. Things would be simpler. But we would also see a > lot of messages from people who don't know (or care) about EOL > translation, and would just complain that Octave sucks because it > can't read their simple files. There are already a number of checks > for \r\n and \r as EOL characters. I think the following patch will > help. I don't see how it could hurt very much, but maybe I'm missing > something. Is lex greedy? if 3 == 1 ... + 2 'true' else 'false' endif will print different things if fed '\r\n' as two NL tokens rather than one. - Paul ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------