Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the following code and I am passing a string example "1011010010" I want to store this string so that each 1 and 0 is in a separate column but I am getting in a separate row instead. What is wrong please?

C#
private void csvExport(string s)
 {
     StreamWriter sw = new StreamWriter("C:\\testdata.csv", true);
     sw.WriteLine(s);
    
     sw.Close();
 }
Posted
Comments
Sergey Alexandrovich Kryukov 12-Nov-12 0:12am    
Why?
--SA
datt265 12-Nov-12 9:59am    
so that I can be able to read any range of characters I want
Sergey Alexandrovich Kryukov 12-Nov-12 13:08pm    
And hence you think that without "separating characters" you won't be able to read it? No, it makes no sense at all.
--SA

Hi,

Read this article:
Reading and Writing CSV Files in C#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900