Des Hutch
Des Hutch

Reputation: 293

Reading large single line text file

I am attempting to read a large html table stored as a single line text file. The text is approx. 81.8 million characters long, around 80mb in size. I have tried the code below but it just hangs for a long time, too long for it to be usable. The data inside is a standard html table construction. <table><tr><td>sometext</td></tr></table>

I cannot change the structure of the file at the source and so stuck with this. The data is to be parsed into a sheet. <tr> on new row and <td> in next cell etc which would occur after reading the text into a MSHTML.Document variable.

Does anyone have a suggestion on how to handle this?

myFile = "C:\xxx\xxx\xxx\xxx.txt"
Open myFile For Input As #1
Line Input #1, textline
Close #1

Upvotes: 0

Views: 307

Answers (1)

Des Hutch
Des Hutch

Reputation: 293

The best solution I came up with was to manipulate the data into a CSV file and have excel/VBA work with it from there. No issues once it had been converted.

Upvotes: 1

Related Questions