Hello, I search for code to read and write text file. I want to open large files(100K +) and then read them and in the end write them back to files.
Thank you very much,
Kiron
Printable View
Hello, I search for code to read and write text file. I want to open large files(100K +) and then read them and in the end write them back to files.
Thank you very much,
Kiron
Reading and writing to text files is easy...
Stick this code in a module and have done with it!!
As for using text files bigger than 100K, you'll have to use a more chunky text box than the one that comes with VB, as that only handles strings upto 64K (I think).Code:Option Explicit
Function OpenFile(Filename As String) As String
On Error Resume Next
Open Filename For Input As #1
OpenFile = Input(LOF(1), 1)
Close #1
End Function
Sub SaveFile(Filename As String, Text As String)
On Error Resume Next
Open Filename For Output As #1
Print #1, Text
Close #1
End Sub
------------------
Matthew Ralston
E-Mail: [email protected]
ICQ:31422892
Web Sites:The Blue Link My Home Page