penguin321
Programmer
I am trying to combine a number of text files into one file using Microsoft Access. I am looping through the files and using Input and Output files to read each line and send it to the new file. I am also checking each line to look for certain key tags so that I can only send portions of the source document to my new file. This works pretty well, except that there are some double quotes in the source files which are not making their way to the destination file. I can understand why this would happen, but is there any way to get around it? I've tried replace the quotes with escape characters, and that didn't work. any help would be appreciated. Thanks.
Here's a snippet of my code:
Dim i As Integer
Dim strLine As String
Debug.Print "START"
i = 1
Open "C:/full.txt" For Output As #2
Do Until i = 667
Open "C:/Source Documents/" & Format(i, "000" & ".txt" For Input As #1
Debug.Print "Reading File " & Format(i, "000" & ".txt"
Input #1, strLine
Do Until strLine = "<h2><B>"
Input #1, strLine
Loop
Input #1, strLine
Do Until strLine = "</h2></B>"
Print #2, strLine
Input #1, strLine
Loop
continue_reading:
Close #1
i = i + 1
Loop
Here's a snippet of my code:
Dim i As Integer
Dim strLine As String
Debug.Print "START"
i = 1
Open "C:/full.txt" For Output As #2
Do Until i = 667
Open "C:/Source Documents/" & Format(i, "000" & ".txt" For Input As #1
Debug.Print "Reading File " & Format(i, "000" & ".txt"
Input #1, strLine
Do Until strLine = "<h2><B>"
Input #1, strLine
Loop
Input #1, strLine
Do Until strLine = "</h2></B>"
Print #2, strLine
Input #1, strLine
Loop
continue_reading:
Close #1
i = i + 1
Loop