I have written the following code segment:
strVar = "one line that I want to write in the text file with extension .csv"
'Set fso = CreateObject("Scripting.FileSystemObject")
'fso.CreateTextFile(str2)
'Set f = fso.OpenTextFile(str2,2,True)
'f.WriteLine(str4)
'str2 holds the name of the file, say abc.csv //this is a comment
the default encoding for text files, I think, is ANSI. However, I want to encode it to IUTF-8. the reason I want to do so is that I have a .temp file encoded in UTF-8 format to append to this csv file, and that is how I need the encoding to be post appending. the temp file is a csv file only, just that it has .temp extension. If I just create the textfile as above, after appending there are a couple of errors in the document.
i am using the following command to append the temp file to the csv file via command prompt which is called by the vbscript:
"copy " &str2 & "+" &str1 & " " &str2
this produces the errors. str1 is the temp file name.
If I can create the text file as with UTF-8 encoding, it would work fine. Alternatively, after I append the temp file to the csv, if I can convert the csv as to have the properties of the temp files, including the encoding, it should be fine too.
Any ideas how any one of these could be done?