hello frnds i am new in development
please help me
i have one text box which i have type for line in that textbox
and this textbox line save in multiple columns
means
aaaaa
bbbbb
cccccc
ddddd
this four line in one textbox and save like
aaaaa bbbbbb ccccccc dddddd like
thanks
Four line in textbox save in multiple excel columns c#.net W
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Posted Sep 26, 2013, 8:26 AM EDT
string textBoxContents = textBox1.Text;
string[] splitter = new string[]{Environment.NewLine};
string appender = ",";
string[] allTextLines = textBoxContents.Split(splitter,StringSplitOptions.RemoveEmptyEntries);
string result = String.Join(appender,allTextLines);
File.AppendAllText("c:\\temp.csv",result);
If you want more explanations of the above code, please let me know.
You need to open the csv file in excel and you'll get the desired output.
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 26, 2013, 8:51 PM EDT
Agree with Muralidharan you can split the the textbox value with Environment.NewLine and process the data.