Skip to content
Prev 156769 / 398506 Next

Manage huge database

Try this:

read.table(pipe("/Rtools/bin/gawk -f cut.awk bigdata.dat"))

where cut.awk contains the single line (assuming you
want fields 101 through 110 and none other):

{ for(i = 101; i <= 110; i++) printf("%s ", $i); printf "\n" }

or just use cut.  I tried the gawk command above on Windows
Vista with an artificial file of 500,000 columns and 2 rows and it seemed
instantaneous.

On Windows the above uses gawk from Rtools available at:
   http://www.murdoch-sutherland.com/Rtools/
or you can separately install gawk.  Rtools also has cut if you
prefer that.
On Mon, Sep 22, 2008 at 2:50 AM, Jos? E. Lozano <lozalojo at jcyl.es> wrote: