Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8303673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:36:03+00:00 2026-06-08T17:36:03+00:00

i have this huge csv file, it’s 4GB, don’t know how many rows but

  • 0

i have this huge csv file, it’s 4GB, don’t know how many rows but 320 columns.

since it can’t be open in any program (except using 3rd party programs to split the file into multiple pieces) i’m trying to fins a way to extract the data i need. i only need about 10-15 columns from it.

i saw many solutions on the net (most in vbs) but i couldn’t get any of them to work. i’d get errors and i don’t know vbs to be able to troubleshoot them.

can anyone help please?

thank you

PS here’s one example of the vbs code i found and tried using that i had no luck with.

the original error was “800a01f4 variable is undefined”, on the net it was suggested to take out OPTION EXPLICIT. once i do that the next error is “800a01fa class not defined”.

in both cases the line giving the error is “Set adoJetCommand = New ADODB.Command”

Option Explicit



Dim adoCSVConnection, adoCSVRecordSet, strPathToTextfile
Dim strCSVFile, adoJetConnection,adoJetCommand, strDBPath


Const adCmdText = &H0001

' Specify path to CSV file.
strPathToTextFile = "C:\Users\natalie.rynda\Documents\Temp\RemailMatch\"

' Specify CSV file name.
strCSVFile = "NPIOld.csv"

' Specify Access database file.
strDBPath = "C:\Users\natalie.rynda\Documents\Temp\RemailMatch\NPIs.mdb"

' Open connection to the CSV file.
Set adoCSVConnection = CreateObject("ADODB.Connection")
Set adoCSVRecordSet = CreateObject("ADODB.Recordset")

' Open CSV file with header line.
adoCSVConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & strPathtoTextFile & ";" & _
    "Extended Properties=""text;HDR=YES;FMT=Delimited"""

adoCSVRecordset.Open "SELECT * FROM " & strCSVFile, adoCSVConnection

' Open connection to MS Access database.
Set adoJetConnection = CreateObject("ADODB.Connection")
adoJetConnection.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);" _
    & "FIL=MS Access;DriverId=25;DBQ=" & strDBPath & ";"
adoJetConnection.Open

' ADO command object to insert rows into Access database.
Set adoJetCommand = New ADODB.Command


Set adoJetCommand.ActiveConnection = adoJetConnection
adoJetCommand.CommandType = adCmdText

' Read the CSV file.
Do Until adoCSVRecordset.EOF
    ' Insert a row into the Access database.
    adoJetCommand.CommandText = "INSERT INTO NPIs " _
        & "(NPI, EntityTypeCode, ReplacementNPI, EIN, MAddress1, MAddress2, MCity, MState, MZIP, SAddress1, SAddress2, SCity, SState, SZIP, ProviderEnumerationDate, LastUpdateDate, NPIDeactivationReasonCode, NPIDeactivationDate, NPIReactivationDate) " _
        & "VALUES (" _
            & "'" & adoCSVRecordset.Fields("NPI").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Entity Type Code").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Replacement NPI").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Employer Identification Number (EIN)").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider First Line Business Mailing Address").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Second Line Business Mailing Address").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Business Mailing Address City Name").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Business Mailing Address State Name").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Business Mailing Address Postal Code").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider First Line Business Practice Location Address").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Second Line Business Practice Location Address").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Business Practice Location Address City Name").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Business Practice Location Address State Name").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Business Practice Location Address Postal Code").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Provider Enumeration Date").Value & "', " _
            & "'" & adoCSVRecordset.Fields("Last Update Date").Value & "', " _
            & "'" & adoCSVRecordset.Fields("NPI Deactivation Reason Code").Value & "', " _
            & "'" & adoCSVRecordset.Fields("NPI Deactivation Date").Value & "', " _
            & "'" & adoCSVRecordset.Fields("NPI Reactivation Date").Value & "')"
    adoJetCommand.Execute
    adoCSVRecordset.MoveNext
Loop



' Clean up.
adoCSVRecordset.Close
adoCSVConnection.Close
adoJetConnection.Close
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:36:04+00:00Added an answer on June 8, 2026 at 5:36 pm

    If your CSV file is straightforward, without newlines or commas in unexpected places, then the standard *nix tool awk would be useful. It would allow you to easily extract the 15 columns you are looking for to a new CSV file. This blog post gives an explanation how to use it on CSV files.

    Suppose that you want to extract columns 1, 3 and 7 from file.csv, then you could do this with the command

    awk -F, '{print $1","$3","$7;}' file.csv
    

    Your Windows machine probably does not have awk installed. There are a few options:

    • You can find it in
      MSYS, which basically
      provides you with a Unix-like shell environment in Windows. To me, this seems to be the easies way to go.

    • Another option seems to be Gawk for
      Windows
      , but I
      have no experience with that, so no guarantees.

    • You could try to achieve the same result using the Windows
      PowerShell, as explained in this blog
      post

      — if you have that available. Again, I have no experience trying that.

    • Last but not least, you could switch to Linux, for example in a
      virtual machine. awk is usually available in *nix environments.

    If you are parsing a more awkward CSV file, then check out parse csv file using gawk for a bunch of suggestions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a huge file for creating this GUI and I have shortened it
I have a huge CSV file I would like to process using Hadoop MapReduce
Let's say I have a dictionary of names (a huge CSV file). I want
I have a 250MB+ huge csv file to upload file format is group_id, application_id,
I have a csv file which is something like this: book_store_id book_price name 1
I have a csv file looks like this col1, col2, col3 1 , John,
I have a simple (but huge) CSV table, and I need to insert a
Scenario: I have a huge .csv file (million of lines) . With sqlldr (SQL
I have a 10GB CSV file which is essentially a huge square matrix. I
I have this huge JSON file. Currently the way I am using it is:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.