I have a text file with following structure :-
C:\\Users\\abc\\Desktop\\New Folder\\sample.txt
AccountName->AbcPos
AccountName->dblLayer
queryAccount-
To get you started wrt the parsing of your (one and only) input file:
As in:
Option Explicit
Const csSep = "->"
Dim oFS : Set oFS = CreateObject("Scripting.FileSystemObject")
Dim oTS : Set oTS = oFS.OpenTextFile("..\data\36060599.txt")
ReDim aData(4)
Do Until oTS.AtEndOfStream
Dim sLine : sLine = Trim(oTS.ReadLine())
Dim sValue : sValue = ""
If InStr(sLine, csSep) Then sValue = Split(sLine, csSep)(1)
Select Case True
Case ":" = Mid(sLine, 2, 1) ' the Path
aData(0) = sLine
Case "AccountName" = Left(sLine, 11)
aData(2 + IsEmpty(aData(1))) = sValue
Case "queryAccount" = Left(sLine, 12)
aData(3 + IsEmpty(aData(1))) = sValue
Case "queryName" = Left(sLine, 9)
aData(4 + IsEmpty(aData(1))) = sValue
Case "next" = sLine ' End Of Record
' WScript.Echo "" & Join(aData, " ") & " "
WScript.Echo "|" & Join(aData, "|") & "|"
ReDim aData(4)
End Select
Loop
oTS.Close
output:
cscript 36060599.vbs
|C:\Users\abc\Desktop\New Folder\sample.txt|AbcPos|dblLayer|qskxyz|def|
|C:\Users\abc\Desktop\New Folder\New folder\sample3.txt|AbcPos|prelLayer|serchTerm|myName1|
|C:\Users\abc\Desktop\New Folder\sample1.txt|AbcPos|dblLayer|qskxyz|qixyz|
|C:\Users\abc\Desktop\New Folder\sample2.txt|AbcPos|prelLayer|serchTerm|myName1|
Can't help you with ASP, sorry.