Importing large files

jhendryx04

New Member
Joined
Jun 3, 2009
Messages
1
I have a text file that is 2.7 GB in size and contains about 4 million rows of data. This cannot be opened in txt format and I need to manipulate the data. I am attempting to upload this data into Access in order to make alterations and run queries. When trying to import, I get a response that there is no data in the file. I need to be able to import but I don't know what else to do.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Unfortunately you'll probably have to read this one line at a time using

Code:
Dim strPath As String
Dim strInput As String
Dim varTemp As Variant
Dim rst As DAO.Recordset
 
strPath = "C:\YourFolder\YourFileName.txt"
Set rst = CurrentDb.OpenRecordset("YourTableNameHere")
 
Open strPath For Input As #1
Do Until EOF(1)
LineInput #1, strInput
 
varTemp = Split(strInput, ",")
 
With rst
   .AddNew
   !Fields(0) = varTemp(0)
   !Fields(1) = varTemp(1)
   !Fields(2) = varTemp(2)
   !Fields(3) = varTemp(3)
   !Fields(4) = varTemp(4)
   !Fields(5) = varTemp(5)
  .Update
Loop
rst.Close
Close #1
Set rst = Nothing

Something like that. Here's more of a reference on this.
 
Upvote 0
How exactly are you trying to import the file?

When do you get the message?

If you are using File>Get external data... do you get as far as the Text Import Wizard?
 
Upvote 0
Another potential issue; the Access file size limit is 2 Gb. If you try to exceed that you will have problems.

Denis
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

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