FSO WriteLine

How can I get a string to be written to a text file in a loop with each new string being written on a new line? I assumed that the code below would do just that but it doesn't work.

Set fileCSV = CreateObject("Scripting.FileSystemObject")
Set textCSV = fileCSV.CreateTextFile(pathTotextCSV, True)

for i = 1 to 10

myString = "hello world"&i
textCSV.WriteLine(fsoString)

next

textCSV.Close

Why does this just create one long line?

View Replies


ADVERTISEMENT

Writeline

I am reading from an xml file and the trying to write the results out to a text file on the server using an asp script

THere is some kind of special characters in one of the fields so it is
causing an error:

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument

How can I strip out these special chars yet keep the html etc. before the writeline I saw a few ~ and box chars that I stripped out of the source xml, I got further but now am stuck again. I cant seem to find this special character, perhaps invisible?

View Replies View Related

Response.writeLine

How can I write a line (with carriage return + line feed) to the client ?
response.write("abcd"), continue the last line, and doesn't put cr+lf.
response.writeLn is illegal syntax...

View Replies View Related

WriteLine Without Crlf

I'd like to write lines to a file, but it always adds an extra line (I assume it's because of the crlf). Is there a way I can add lines without the auto crlf, so that I add the last line and not the crlf?

View Replies View Related

Writeline Permission Denied

I'm trying to append to a file a string such as the following: 127599.0
127838.5 14.434 87

first error - 500 internal server error
refresh
second error - echoes string...does not append file
refresh
third error - permission denied

<%set
file=server.createobject("scripting.filesystemobject").opentextfile(server.m
appath("mpg.txt"),8)
file.writeline(request.querystring("start")&"
"&request.querystring("finish")&" "&request.querystring("gallons")&"
"&request.querystring("octane"))
file.close%>

View Replies View Related

WriteLine With <% %> And Double Quote Signs

I create an ASP file using fso.createtextfile. But how do I avoid double quotes and <% %signs when writing to file?

FileAsp.WriteLine("<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252">")
FileAsp.WriteLine("<!-- #Include file="file.asp" -->")
FileAsp.WriteLine(" <% =Blah %>")

View Replies View Related

Error On Obj.writeline (writing A File)

I'm writing a asp file dynamically. The code works 70% or the time. It pulls info from access and creates the file -- for some reason though some characters (and I see nothing different about these) causes the following error on the line objfile.writeline

What can I do?

error is:

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved