Importing large text files into Excel.

keithmlewis

New Member
Joined
Apr 16, 2002
Messages
1
I am trying to import a text file that is over 300,000 lines long. However, the Excel rows stop at 65,536 and import wizard will not let you select which line of the import file you would like to start with. Please post all help on importing text files into Excel.

Thank you
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Keith,

As always, there are a number of options.

If this is a one-time thing, then the best way to deal with it is to divide your input file into bite-size chunks, or extract just the chunk you want, using an editor. For example, you could use WordPad to just delete out all the records not of interest, and save the remaining records to a new file to be imported.

On the other hand, if you plan on importing this file or similar files many times, it would be worth your while to write a macro to do the import. A macro could provide several ways to handle your problem:

1. It could read all your data and wrap the data to additional worksheets;

2. If you are only interested in reading certain records rather than all records from the input file, it could filter the records while reading them, thereby reducing the total number of records to fit on one sheet;

3. If you want to skip a certain number of records, or perhaps just read a block of records from the file, it could do this based either on record number, or some value in the record fields that indicates when to start and stop writing records to Excel.

A VBA macro can gain this flexibility via use of standard file I/O rather than using the Excel import or open capability. If you are interested in investigating this, see the VBA helps for file I/O statements like Open, Line Input #, Input #, Close #, and EOF. It is not hard to do, but if you need a simple example to get started, follow up with your email address and I will send you one.
 
Upvote 0
If you want to do data analysis on the information while keeping it together you can importe it to access and run pivot tables from excel to the data in access. I have done this many times and works great for me.
 
Upvote 0

Forum statistics

Threads
1,214,549
Messages
6,120,149
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top