Hi everyone,
I am working on a VB6 project and I need to extract plain text from a text file. Here is code of the function I used to do that:
Private Function FileGetText(TextFile As String) As String
Dim FileContent As String
Dim TextLine As String
Dim n As Integer
n = FreeFile
Open TextFile For Input As #n 'Open given Text File
Do Until EOF(n)
Input #n, TextLine
FileContent = FileContent & TextLine & vbCrLf 'Initialize text file contents line-by-line to FileContent variable
Loop
Close #n
FileGetText = FileContent
End Function
The problem with this function is that, though it reads text from file line by line, but when encounters (,) coma in the string, it takes the suffixed string as in another line, how can I prevent it from doing so and take (,) literally??
Thanks in Advance..... :-)