Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Joerg Luedicke <joerg.luedicke@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: CSV read with limits |
Date | Fri, 11 Mar 2011 15:30:52 -0500 |
On Fri, Mar 11, 2011 at 12:16 PM, Argyn Kuketayev <akuketayev@mail.primaticsfinancial.com> wrote: > the file is 6GB, too large. There's >100 variables, and I need only 3 or 4. > RE variable selection: If you know the column positions of your variables you could try -infile- as shown in the example below. In the example, a data set with 20 variables is created and saved as csv file. Then, 4 variables from column 5, 10, 15, and 20 are read: /*Example*/ clear set obs 100 forvalue i= 1/20{ gen var`i'=rnormal() } outsheet using test1.csv, comma replace infile _skip(4) vno1 _skip(4) vno2 _skip(4) vno3 _skip(4) vno4 using test1.csv, clear /*end example*/ J. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/