Extra Space in Reading Text File

Results 1 to 2 of 2

Thread: Extra Space in Reading Text File

  1. #1
    Join Date
    Dec 1969

    Default Extra Space in Reading Text File

    I am reading the contents of a text file and writing them into a textarea. The contents are written fine, but there is always an extra blank line at the end of the textarea. This is my code:<BR><BR>&#060;TEXTAREA NAME="source" COLS="75" ROWS="20"&#062;<BR>&#060;%<BR><BR>Set objFS = Server.CreateObject("Scripting.FileSystemObject")< BR>Set objFile = objFS.OpenTextFile(strLocation,ForReading,Tristate False)<BR><BR>WHILE NOT objFile.AtEndOfStream<BR>strLine = objFile.ReadLine<BR>strLine = Server.HTMLEncode(strLine)<BR>Response.Write(strLi ne) & VbCrLf<BR>WEND<BR><BR>objFile.Close<BR><BR>%&#062; <BR>&#060;/TEXTAREA&#062;<BR><BR><BR>Thanks and I appreciate any help.

  2. #2
    Join Date
    Dec 1969

    Default RE: Extra Space in Reading Text File

    I believe the problem here is the last characters you print are CRLF that move the cursor 2 a new line. So to stop you would<BR>A) Know when you are on the last line and not print the CRLF. <BR>B) Print the CRLF b4 the String and make sure it isn&#039t done on the first line.<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