[R] read file part way through based on start and end date (first column)

jim holtman jholtman at gmail.com
Sun Mar 20 22:04:33 CET 2011


How big is the file?  WHy not read the entire file in and then use
'subset' to extract only the data that you want?  If the file is too
large to be able to read in, then you could put it in a database and
use SQL to extract what you want.  You could also create a 'perl'
script to filter the data before reading into R.  So a little more
specificity is needed to understand the problem you are trying to
solve.

On Sun, Mar 20, 2011 at 3:47 PM, algotr8der <algotr8der at gmail.com> wrote:
> Hello folks - I have been trying to figure this out. I have a set of very
> large files that are of this format
>
> , , , ,
> 1/4/1999,9:31:00 AM,blah, blah, blah
> 1/4/1999,9:32:00 AM,blah, blah, blah
> 1/4/1999,9:33:00 AM,blah, blah, blah
>
> I want to write R code that reads only that data between a start and an end
> date (data is presented from oldest at the top of the file to the most
> recent at the bottom of the file). I'm not sure if there is an R function
> that makes this easy.
>
> I know the read.csv function enables you to skip a user specified number of
> rows before the file is read but this doesnt exactly help me as my start and
> end dates can be anywhere in between.
>
> Appreciate the help.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/read-file-part-way-through-based-on-start-and-end-date-first-column-tp3391769p3391769.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?



More information about the R-help mailing list