Skip to content

Instantly share code, notes, and snippets.

@eggist77
Last active December 24, 2022 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggist77/393ed5329dfcaed503a49c13163a694f to your computer and use it in GitHub Desktop.
Save eggist77/393ed5329dfcaed503a49c13163a694f to your computer and use it in GitHub Desktop.
'Write to a text file
'iomode
Const ForReading = 1, ForWriting = 2, ForAppending = 8
txtFile = "txtfile.txt"
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(txtFile, ForAppending, True)
' header
If f.line = 1 Then
f.WriteLine "title1,title2,title3"
End If
f.WriteLine "data1,data2,data3"
f.Close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment