I am writing data to an appending text file. However, each batch file that is written has a header line(these are all the same). The first header line is fine, but I don't not want any more subsequent headers after that. Here is the code I have now, but for some reason it is not deleting any of my header lines... Any suggestions or other possible solutions?
Open "c:\officeOutput.txt" For Append As #2
'delete extra header lines
For i = 0 To UBound(lines)
str = lines(i)
If InStr(str, "COLUMNS") > 0 Then
lines(i) = vbNullChar
'uses filter to delete lines
lines = Filter(lines, vbNullChar, False)
For j = 1 To UBound(lines)
Print #2, getField(j,1) + getField(j,2)+getField(j,3)....