This is the gist of it. I removed the functions concerning what is to be done with the data, etc.; since that doesn't effect the extraction procedure. Since there is a specific pattern to the data I wish to extract, I didn't use a form input field allowing it to be actively defined. Now my only hurdle will be ensuring the best quality scan/OCR conversion to text.
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
If len(trim(Request.Form("FullFilePath"))) > 0 Then
Dim objFSO, FilePath, FullFilePath
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
FilePath=Server.MapPath(Request.Form("FullFilePath"))
If objFSO.FileExists(FilePath)Then
Const fsoForReading = 1
iomode=1
Dim objTextStream
Set objTextStream = objFSO.OpenTextFile(FilePath, fsoForReading)
Do while not objTextStream.AtEndOfStream
strStart="":strEnd=""
strLine=objTextStream.ReadLine
For i = 1 to len(strLine)
If mid(strLine,i,3)=".az" Then
For j=1 to len(strLine)
If mid(strLine,j,1)="!" Then
Exit For
End If
Next
intLen=j+1-i
strData=mid(strLine,i,intLen)
For j=1 to len(strData)
If mid(strData,j,1)=" " Then
strStart=left(strData,j-1)
strEnd=mid(strData,j+1)
Exit For
End if
Next
End if
Next
If strStart>"" Then
Response.Write "<form action=""Data.asp"" method=""post"">" & vbNewLine & _
" <input type=""hidden"" name=""ID"" value=""" & intID & """>" & vbNewLine & _
" <table align=""center"" width=""75%"" bgColor=""transparent"" border=""0"" style=""border-collapse:collapse;"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"" colspan=""2"" bgColor=""lightblue"">" & vbNewLine & _
" <font face=""courier new"" size=""6"" color=""navy""><b>Data Info</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""50%"" bgColor=""lightgrey"">" & vbNewLine & _
" <font face=""courier new"" size=""5"" color=""black""><b>Start</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""50%"" bgColor=""lightgrey"">" & vbNewLine & _
" <font face=""courier new"" size=""5"" color=""black""><b>End</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""50%"" bgColor=""white"">" & vbNewLine & _
" <font face=""courier new"" size=""4"" color=""navy"">" & vbNewLine & _
" <input type=""text"" size=""100"" maxwidth=""255"" name=""strStart"" value=""" & strStart & """>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""50%"" bgColor=""white"">" & vbNewLine & _
" <font face=""courier new"" size=""4"" color=""navy"">" & vbNewLine & _
" <input type=""text"" size=""100"" maxwidth=""255"" name=""strEnd"" value=""" & strEnd & """>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""top"">" & vbNewLine & _
" <td align=""center"" width=""100%"" bgColor=""transparent"">" & vbNewLine & _
" <input type=""image"" src="""& strImageURL &"submit.png"" height=""40"" width=""80"" value=""Add New"">" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
' Exit Do
End If
Loop
objTextStream.Close
Set objTextStream=Nothing
Else
Response.Write "File not found!"
WriteFooter
Response.End
End if
Set objFSO = Nothing
Else
'Create Form
Response.Write "<form action=""map.asp"" method=""post"">" & vbNewLine & _
" <table align=""center"" width=""75%"" bgColor=""transparent"" border=""0"" style=""border-collapse:collapse;"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"" bgColor=""lightblue"">" & vbNewLine & _
" <font face=""courier new"" size=""6"" color=""navy""><b>Source File</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"" bgColor=""white"">" & vbNewLine & _
" <font face=""courier new"" size=""4"" color=""navy"">" & vbNewLine & _
" <input type=""text"" size=""100"" maxwidth=""255"" name=""FullFilePath"" value="""">" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""top"">" & vbNewLine & _
" <td align=""center"" width=""100%"" bgColor=""transparent"">" & vbNewLine & _
" <input type=""image"" src="""& strImageURL &"submit.png"" height=""40"" width=""80"" value=""Submit"">" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
End If
WriteFooter
%>