csv - How to write quoted strings to files in C#? -
csv - How to write quoted strings to files in C#? -
this question has reply here:
writing string contains “ ” 6 answersi making new .csv file in c# using streamwriter , writing file writeline("stuff write")
method. problem cannot seem write quoted strings, i.e. writeline(" "dog" ")
"dog" quoted. tried using double quote method: writeline(@"""dog""")
still didn't work (just wrote dog
in csv file). how can write quoted strings files?
i'm assuming you're opening in excel, why you're not seeing quotes - excel tries smart when open csv files, it's taking out quotes, though there in raw file.
open result file in text editor, , you'll see quotes when writeline(@"""dog""")
approach (or more mutual writeline("\"dog\"")
).
c# csv
Comments
Post a Comment