Quantcast
Channel: Classic ASP
Viewing all articles
Browse latest Browse all 488

Reading From a text file and splitting the string

$
0
0

Hi, 

I am having trouble reading from a text file. 

It is suppose to read from the text file in a loop. Going through line by line. For each line, there will be a separator "|". I need it to split the string according the the separator and get the values. 

I am only using a text file as the company server would not allow me to use any kind of database. 

Please do help. 

Thanks,

-J

Extract of code : 

<% sub checkmx()

path = "C:/inetpub/wwwroot/HASE/aio.txt"

nric = Response.write(request.querystring("IC"))

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(path,1)

count = 0
do while not f.AtEndOfStream
f.readline

checkmx = split(f.readline,"|")
mx = checkmx(1)
checknric = checkmx(0)
count = count + 1

if nric = checknric then

found = 1

else
found = 0
end if

loop

if MX = "A" then
%>
<a href="GenMX11A.html">Job Description of Jobs Available</a>
<%elseif MX ="11" then %>
<a href="GenMX11.html">Job Description of Jobs Available</a>
<% end if
response.write("mx")
end sub
%>


Viewing all articles
Browse latest Browse all 488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>