Insert from text file

Results 1 to 3 of 3

Thread: Insert from text file

  1. #1
    Romi Guest

    Default Insert from text file

    Wondering how to insert lines from a text file into an html page - I must have my CreateObject wrong?<BR><BR>&#060;%<BR>Dim filesys, txtfile, line<BR>Set filesys = CreateObject("Scripting.FileSystemObject")<BR>Set txtfile = _<BR> filesys.OpenTextFile("C: emp empfile.txt",1, 0)<BR>Do<BR> line = txtfile.ReadLine<BR>%&#062;<BR>&#060;%=line%&#062; <BR>&#060;%<BR>Loop Until txtfile.AtEndOfStream<BR>txtfile.Close<BR>%&#062;< BR><BR>Thanks<BR>

  2. #2
    mackjack Guest

    Default RE: Insert from text file

    Check out at<BR><BR>OR<BR><BR><BR>&#06 0;%<BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>file name = server.mappath("/somedirectory/readfile.txt")<BR>Set thisfile= fs.OpenTextFile(filename,1,False)<BR>Do until thisfile.AtEndOfStream<BR>thisline = thisfile.readline<BR>If thisline &#060;&#062; "" then<BR> Response.write thisline & "<BR>"<BR>End If<BR>Loop<BR>thisfile.close<BR>set thisfile = Nothing<BR>set fs = Nothing<BR><BR>%&#062;

  3. #3
    Join Date
    Dec 1969

    Default function to read a text file

    I posted a similar answer a while back:<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts