I am in the process of modifying some code that reads a .txt file after it has been created from .pdf (this works great) and find a specific line in the text file. Once I have found this line (it will be in every text file but on a different line) I then want to use the line directly below it to complete a calculation. I can also go about it like this: I can go to the end of the text file (no clue as to how to program this) and subtract 6 from the line count to do the calculation on the correct line. The line I am trying to get at is always the 6th line from the bottom, but varies from the top of the file.
Currently I have something like this:
If InStr(lineNo, "Credits Debits Difference") Then
lineNo = lineNo + 1
For Each i In Split(line)
If (IsNumeric(i)) Then
totalItems = totalItems + i
End If
Next
End If
Credit Debit Difference is the text I am looking for in the txt file. lineNo is just a variable I set up to advance and read each line in the text file.
Thank you for any suggestions.
Currently I have something like this:
If InStr(lineNo, "Credits Debits Difference") Then
lineNo = lineNo + 1
For Each i In Split(line)
If (IsNumeric(i)) Then
totalItems = totalItems + i
End If
Next
End If
Credit Debit Difference is the text I am looking for in the txt file. lineNo is just a variable I set up to advance and read each line in the text file.
Thank you for any suggestions.
Comment