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
Loading
Jignesh TrivediPosted Sep 27, 2013, 12:51 AM
Agree with Muralidharan you can split the the textbox value with Environment.NewLine and process the data.
Posted Sep 26, 2013, 12:26 PM
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.