vb.net - StreamWriter.WriteLine not writing in new line -
vb.net - StreamWriter.WriteLine not writing in new line -
i using next code write datatable text file.
using sbdata new streamwriter(filename, false, encoding.utf32) sbdata.write(string.join("\t", datatable.columns.cast(of datacolumn)().select(function(arg) arg.columnname.trim()))) sbdata.writeline() each datarow datarow in datatable.rows sbdata.write(string.join("\t", datarow.itemarray.select(function(arg) arg.tostring().trim()))) sbdata.writeline() next sbdata.flush() sbdata.close() end using
data getting written text file neither \t (tab) working nor writeline. instead of tab getting "\ t" in text file , in continuation. 1 having thought whats wrong here?
"\t"
works in curly brace languages, c#, have utilize vbtab in vb.net.
using utf32 plain weird , reason writeline() doesn't seem work. whatever programme utilize @ file not expect , guess @ wrong encoding. reason saw space in "\ t". writing bom not optional when utilize unusual encodings. consider using encoding.utf8 instead, default streamwriter.
vb.net streamwriter
Comments
Post a Comment