Hello,

Well, you can also automate the process of reading multiple files and
generate a big and unique file, but that choce is again more complex than
running an awk or perl script.

In awk it would be as simpler as this:

gawk ' { if(NF>1) print $0 } ' bigfile.in > bigfile.out

Regards,
Carlos Ortega.


On 3/8/06, Arne.Muller@sanofi-aventis.com <Arne.Muller@sanofi-aventis.com>
wrote:
>
> Well, the data is generated by a perl script, and I could just configure
> the perl script so that there is one file per data table, but I though I'd
> probably must more efficent to have all records in a single file rather than
> reading a thousands of small files ... .
>
>        kind regards,
>
>        Arne
>
> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch]On Behalf Of Philipp Pagel
> Sent: Wednesday, March 08, 2006 12:44
> To: r-help@stat.math.ethz.ch
> Subject: Re: [R] data import problem
>
>
> On Wed, Mar 08, 2006 at 12:32:28PM +0100, Arne.Muller@sanofi-aventis.comwrote:
> > I'm trying to read a text data file that contains several records
> > separated by a blank line. Each record starts with a row that contains
> > it's ID and the number of rows for the records (two columns), then the
> > data table itself, e.g.
> >
> > 123 5
> > 89.1791    1.1024
> > 90.5735    1.1024
> > 92.5666    1.1024
> > 95.0725    1.1024
> > 101.2070    1.1024
> >
> > 321 3
> > 60.1601    1.1024
> > 64.8023    1.1024
> > 70.0593    2.1502
>
> That sound like a job for awk. I think it will be much easier to
> transform the data into a flat table using awk, python or perl an then
> just read the table with R.
>
> cu
>        Philipp
>
> --
> Dr. Philipp Pagel                            Tel.  +49-8161-71 2131
> Dept. of Genome Oriented Bioinformatics      Fax.  +49-8161-71 2186
> Technical University of Munich
> Science Center Weihenstephan
> 85350 Freising, Germany
>
> and
>
> Institute for Bioinformatics / MIPS          Tel.  +49-89-3187 3675
> GSF - National Research Center               Fax.  +49-89-3187 3585
>      for Environment and Health
> Ingolstädter Landstrasse 1
> 85764 Neuherberg, Germany
> http://mips.gsf.de/staff/pagel
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

	[[alternative HTML version deleted]]


