Skip to content
Prev 274785 / 398506 Next

How to read data sequentially into R (line by line)?

I thought that you wanted a separate file for each of the breaks
"GG!KK!KK!".  If you want to read in some large number of lines and
then break them so that they have that many lines, you can do the same
thing, except scanning from the back for a break.  So if your input
file has 14M breaks in it, then the code I sent would create that many
files.  If you want a minimum number of lines per file, including the
breaks, then it can be done.  You just have to be clearer on exactly
what the requirement are.  From your sample data, it looks like there
were 7 text lines per record, so if your input was 14M lines, I would
expect that you would have something in the neighborhood of 1.8M files
with 7 lines each.  If you had 14M lines in the file and you were
generating 14M files, then there is something wrong with your code is
that it is not recognizing the breaks.  How many lines did each file
have in it?
On Tue, Oct 18, 2011 at 9:36 AM, johannes rara <johannesraja at gmail.com> wrote: