| | |
import textfile to excel
![]() |
•
•
Join Date: Feb 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi All,
I have a problem to solve.I am importing 200000 records(.txt) in notepad into excel but when it gets to 65000 records it truncates telling me that not completely exported.I now write a code in vb editor(excel) trying to count every 5records and export to excel.Please, have a look at this code and correct.Thanks.
rgds
jimi
I have a problem to solve.I am importing 200000 records(.txt) in notepad into excel but when it gets to 65000 records it truncates telling me that not completely exported.I now write a code in vb editor(excel) trying to count every 5records and export to excel.Please, have a look at this code and correct.Thanks.
rgds
jimi
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public NumberOfRecords As Integer Dim data(i, 2) As String Dim g, fileName As String Dim i, numlines, lines, As Integer Dim line_Name(i), short_Point(i), x(i), y(i), s(i) As Double Private Sub OpenFileBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFileBtn.Click If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then 'opens file of users choice if cancel not pressed FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input) lines = getNumLines(1) FileClose (1) FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input) ReDim data(lines, 2) For i = 0 To i = lines - 1 Input(1, data(i, 0)) Input(1, data(i, 1)) Input(1, data(i, 2)) line_Name(i) = Val(data(i, 0)) short_Point(i) = Val(data(i, 1)) x(i) = Val(data(i, 2)) y(i) = Val(data(i, 3)) s(i) = Val(data(i, 4)) Next i FileClose (1) End If End Sub Public Function getNumLines(ByVal fileName As Integer) As Integer Dim numlines As Integer numlines = 0 While Not (EOF(1)) numlines = numlines + 5 'counts number of rows in the file Input(5, g) End While Return numLines 'return the number of lines found End Function End Class
Last edited by Comatose; Mar 9th, 2007 at 4:34 pm.
![]() |
Similar Threads
- Hoping for Help - Import File into Excel (Visual Basic 4 / 5 / 6)
- Error message while importing data to Excel from the MySQL db (MySQL)
- Exporting Data from App To Excel c# (C#)
- MS Excel data to ASP form (ASP)
- Import info from excel to access (MS Access and FileMaker Pro)
- How to export excel data to a search engine? (MS Access and FileMaker Pro)
- How do import a worksheet to HTML? (HTML and CSS)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: ADODB Y DAO together ?
- Next Thread: Is This Project Possible?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





