On Thu, 22 Jan 2004, Greg Riddick wrote:

> I'm reading a file into a list by:
> PDF = scan("file",what="character",sep="\10")
> 
> "\10" is the newline character in this file, also tried "\n" originally
> 
> On lines that are ended by "\13\10", both are dropped from the list entry
> I want scan to keep the "\13" in the list entry.
> 
> Is this a bug or just a strange feature?

Not a strange feature, but the documented behaviour (and useful, too).  
You have opened the file in text mode.  If you want to keep CRs, open and
read in binary mode.

-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to