[Numpy-discussion] loadtxt broken if file does not end in newline

Christopher Barker Chris.Barker@noaa....
Wed Feb 27 14:19:28 CST 2008

David Huard wrote:
> The advantage of using regular expressions is that in this case it gives 
> you some flexibility that wasn't there before. For instance, if for any 
> reason there are two type of characters that coexist in the file to mark 
> comments, using

> pattern = re.compile(comments)
> can take care of that automatically if comments is a regular expression.

OK -- but loadtxt() doesn't support that now anyway. I'm not writing the 
code, nor using it at the moment, so It's fine with me either way, but 
the re should certainly support the examples I gave that don't work now. 
(plus probably others, that's not a comprehensive list of possibilities.)


> 2008/2/27, Christopher Barker <Chris.Barker@noaa.gov 

>     This pattern fails if the last character of the line is a comment
>     character, and if it is a comment only line

Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Numpy-discussion mailing list