Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help writing to comma delimited file

Status
Not open for further replies.

ob1kanobee

Programmer
Dec 27, 2002
47
0
0
US
Help! I am unable to correctly write to a comma-delimited file. What am I doing wrong?

var fso, f1, csvFile, outputLine;
var ForWriting = 2;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.GetFile("c:\\MyText.csv");
csvFile = f1.OpenAsTextStream(ForWriting, true);
csvFile.WriteLine("ArrayValue1,ArrayValue2,ArrayValue3");
csvFile.close();

When I open the written CSV file, all the array info. is on first cell.

 
Nevermind, I just figured it out:

var ForAppending = 8;

csvFile = fso_OpenTextFile("c:\\MyText.csv", ForAppending, false);
csvFile.WriteLine("ArrayValue1,ArrayValue2,ArrayValue3");
csvFile.close();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top