text file manipulation in ASP

Results 1 to 2 of 2

Thread: text file manipulation in ASP

  1. #1
    Join Date
    Dec 1969

    Default text file manipulation in ASP

    Any help on this would be greatly appreciated...<BR><BR>I&#039;m pulling hyperlinks to text files out of my database with ASP & SQL with ease, but how exactly do I write the text file to the webpage? I&#039;ve looked into the whole FileSystemObject and TextStream stuff on this site, but I&#039;m encountering constant errors trying to make this work (I dont have a great handle on it yet). But is there any easier way to write the text file to the browser, even if it&#039;s not an ASP solution? <BR><BR>I&#039;m also in the dark about what y&#039;all use as source files for body copy. For example, are you using raw text files and then styling them, or converting word documents into html...? I&#039;m trying to modernize a newspaper&#039;s site where the writers submit about 20 different word processor file types, so any insight into that process would be extremely helpful.<BR><BR>A plate of virtual thank you cookies goes to anyone who responds. Thanks -zac

  2. #2
    Join Date
    Dec 1969

    Default RE: text file manipulation in ASP

    Make the changes in file and box names.<BR><BR>&#060;%<BR>Option Explicit<BR>&#039;Delare variables<BR>Dim fso,infile,curinfo<BR>&#039;Open the text file using FileSystemObject<BR>Set fso=Server.CreateObject("Scripting.FileSystemObjec t")<BR>Set infile=fso.OpenTextFile(Server.Mappath("yourtextfi le.txt"))<BR>%&#062;<BR><BR> &#060;select name="yourname" size=25 style="font-family: Trebuchet MS; font-size: 12pt; font-weight: bold"&#062;<BR> &#060;%<BR> &#039;Loop through text file and make the list of text<BR> Do Until infile.AtEndOfStream<BR> curinfo=infile.ReadLine<BR> Response.Write("&#060;option&#062;" & curinfo & vbcrlf) <BR> Loop<BR> %&#062;<BR> &#060;/select&#062;<BR><BR>&#060;%<BR>&#039;close all objects<BR>infile.close<BR>Set fso=nothing<BR>Set infile=nothing<BR>%&#062;

Posting Permissions

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