In the below code, I was able to loop through 9 (amount of files will vary) txt files and grab a certain line within those text files. The value I grabbed is a quantity value and always listed in the same spot. I’m having some difficulty getting a sum of those quantities.
Current code:
Set oFile2 = FSO.OpenTextFile(File.path, ForReading)
i = 0
'process text files
Do While oFile2.AtEndOfStream <> true
text = oFile2.ReadLine
'WSCript.Echo text
ReDim Preserve SSheet(i)
SSheet(i) = text
i=i+1
Loop
oFile2.Close
Set oFile2 = Nothing
Set objFSO = Nothing
'find row and strips down quantity
Dim QtyTrim
QtyTrim = Mid((SSheet(30)),6,4)
'convert quantity to int
Dim QtyInt
QtyInt = CInt(QtyTrim)
WSCript.echo QtyInt