Results 1 to 4 of 4

Thread: Import CSV of 81000 lines

  1. #1
    Join Date
    Mar 2009
    Posts
    176

    Import CSV of 81000 lines

    It's a crazy business! Import a file of 81000 lines in Excel! The fact is that I do not know the handling and excel can only handle 65536 lines the max ...

    I looked to cut and partition the file but unfortunately, every attempt has failed! Then how is this possible?

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Import CSV of 81000 lines

    Here is a code that I use for text files, I simply adapted the extention .csv, normally it should be OK

    Code:
      Sub ImportTxtNew () 
      Sun Line As String, strFullName, i As Long, As Long NbWs 
      Sun Deb As Variant, End As Variant, Diff As Date 
        
      Deb = Now () 
        
          Worksheets. Add 
          strFullName = Application. GetOpenFileName ( "Text Files (*. csv), *. csv", _ 
          "Select a file:") 
        
          StrFullName Open For Input As # 1 
        
          Do While Not EOF (1) 
                  Do While (Not EOF (1)) And (i <65500) 
                      i = i + 1 
                      Input # 1, line 
                      Cells (i, 1). Value = line 
                  Loop 
              If i <EOF 65,500 Gold (1) Then Exit Do 
                  i = 0 
                  Worksheets. Add 
          Loop 
          Close # 1 
    
      End Sub

  3. #3
    Join Date
    Mar 2009
    Posts
    176

    Re: Import CSV of 81000 lines

    Thank you for your help, but I am not an expert on the subject, so I do not know what to do with your "script" ...

    With a little fiddling, I found how to add the macro. But I get an error message:

    "Excel can not complete this task with available resources. Choose less data or close other applications."

    So what I do?

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Import CSV of 81000 lines

    It is rather a PC problem, the application closes, if you have nothing else to stress you've opened!

    Are there calculations based on your import? If yes, put the calculations in "manual" (Tools\Options\Calculation) before import and after reactive.

Similar Threads

  1. Grid lines in Brink
    By Man-Than in forum Video Games
    Replies: 6
    Last Post: 20-05-2011, 10:24 AM
  2. Why are T1 lines so expensive?
    By Shakaal in forum Networking & Security
    Replies: 4
    Last Post: 16-09-2010, 12:18 PM
  3. Red Lines Down in Monitor
    By Relish in forum Monitor & Video Cards
    Replies: 3
    Last Post: 02-09-2009, 01:23 PM
  4. Selecting Lines
    By puk284 in forum Software Development
    Replies: 0
    Last Post: 25-06-2009, 07:55 PM
  5. How to use sed to insert lines in a file
    By McGrawh in forum Software Development
    Replies: 2
    Last Post: 24-06-2009, 11:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,718,307,464.89229 seconds with 17 queries