Company prints production tickets and then scans each Serial Number barcode into a software package. There are ~200 pages each day, so it takes time... I thought we could print them to a text file then I could grab out each Serial Number and save them to another file. however the word Serial Number is like so, a few letters on each line.
Ser
i
al
#
(as well as most other data in the file so finding anything is not so easy).
Can someone help me more efficient code, better code than try and look for "Ser" then "i" etc.
TIA
Ser
i
al
#
(as well as most other data in the file so finding anything is not so easy).
Can someone help me more efficient code, better code than try and look for "Ser" then "i" etc.
Code:
Using w As StreamWriter = File.AppendText(SpringFile)
Me.ListBox1.Items.Add("Reading Print File")
Dim objReader As New System.IO.StreamReader(FILE_NAME)
Me.ListBox1.Items.Add("Writing Serial# file")
Do While objReader.Peek() <> -1
Linedata = objReader.ReadLine()
If InStr(1, Linedata, "Ser") Then
'save to another text file
If InStr(1, Linedata, "Ser") Then
FindSerialNumberStart = InStr(1, Linedata, "Ser")
SerialNumber = Trim(Mid(Linedata, FindSerialNumberStart, 16))
w.WriteLine("*" & SerialNumber & "*")
w.WriteLine(SerialNumber)
End If
End if
Loop
TIA