Hi,
I have searched for a way of reading the contents of a textarea into a two-dimensional array.
Say this is the textarea populated with content from a log:
<asp:TextBox ID="txtLog" Width="600px" Height="400px" TextMode="MultiLine" runat="server">
17/11/2010 09:34:46,codewriter31,email_Add_1,anyname@there.com
17/11/2010 09:34:46,codewriter31,email_Add_2,
17/11/2010 09:34:46,codewriter31,town_or_City,London
17/11/2010 09:35:22,gamer4,email_Add_1,petname@myhome.com
17/11/2010 09:35:22,gamer4,email_Add_2,
17/11/2010 09:35:22,gamer4,town_or_City,Pais
17/11/2010 09:39:08,tom_thumb,email_Add_1,someone@somewhere.com
17/11/2010 09:39:08,tom_thumb,email_Add_2,person@isp.com
17/11/2010 09:39:08,tom_thumb,town_or_City,New York
</asp:TextBox>
Each line has timestamp, user name, field name and optional value.
There are many code samples to read from a textfile but I am stuck with a textarea.
This code only gives me a one-dimensional array of lines:
char[] splitter = { '\n' };
string[] arrLine = Log.Split(splitter);
Does anyone have any pointers for me please?
E.g. array, ArrayList, List, Dictionary, hash table, DataTable?
How to read the textarea into it?
I am using C# ASP.NET 3.5.
Thank you