I've been trying to check if a given txt file has lines that start with a particular word. I then want to count the number of lines that start with that word. Though I can't quite get it right, I do think I'm somewhat close with the check. Any and all help are much appreciated! Here's my code so far
.Pattern = "(\nC_PIN\s)(\b\d\b\s)"
.Global = True
Set objFil3 = objFSO.OpenTextFile(inFileName)
If objFil3.IsMatch(inFileName) Then
MsgBox "File OK"
Else: MsgBox "Wrong file type chosen. Please check directory"
End If