working with large text files

G

Guest

Hello.

I have a text file which has over 65536 rows.

I'd like to import the whole thing into Excel... multiple sheets is fine.

So, I need to put the first 65k+ (or half, it doesn't matter) rows on one
sheet, and the rest on another. I could do that manually, easy enough, but
it will need to be done again, with data that will change, etc.

To do that programatically, I could open the file and walk through reading
and placing the lines.

My question is if anyone has a good suggestion as to how to do that more
quickly than reading through over 65k lines individually... a method to read
half of the file in on one sheet, and the second half of the file in on
another sheet. I think it's safe to assume, for this purpose, that it will
never have more rows than in two sheets.

Thanks.
Mark
 
G

Guest

If these records are in an array, you can simply assign a range to them as
opposed to cycling through them.
 
G

Guest

If these records are in an array, you can simply assign a range to them as
opposed to cycling through them.

I'm not quite sure if that answers my question or not.

The records are currently in a text file, totally outside of Excel... just a
plain flat file.

Once I get them into Excel, sure, I can assign a range name to them.

But the question was about methods of splitting the flat text file and
getting them into Excel.
 
G

Guest

Thanks, Gary.

As you likely know, the code on that post cycles through importing one row
at a time, so as it says, it will run a good while.

I was hoping that there was a way to read the size of the file, or
preferably, the number of lines in the file, and import half of it as a chunk.

But perhaps not.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top