There is no way for read.table to skip columns. It is however very easy to do this with a preprocessing of the table: cut, awk and perl all come to mind, and you could do it in R too, reading a block of rows at a time and writing them back out.
scan() can skip columns, but I would still use preprocessing with scan. On Mon, 9 Aug 2004, F Duan wrote: > I have a very big tab-delim txt file with header and I only want to import > several columns into R. I checked the options for “read.table” and only > found “nrows” which lets you specify the maximum number of rows to read in. > Although I can use some text editors (e.g., wordpad) to edit the txt file first > before running R, I feel it’s not very convenient. The reason for me to do this > is that if I import the whole file into R, it will eat up too much of my > system’s memory. Even after I remove it later, I still can’t release the memory. The peculiar quotes suggest this is Windows -- the Rtools we use to build R there contain a cut.exe. -- 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