Click here to Skip to main content
16,011,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I am working on C# windows base application where I selected a particular row from a text file now I have to select only four field from the row and display in four text box where every field is separated by Tab Space in the same row and that row has thirty field
Posted

//whole textbox data is copied to a string
string strTextBoxData = YourTextbox.text;

string[] strSplitResult = str.Split(" ", StringSplitOptions.RemoveEmptyEntries);//string array will now have all data index by index
 
Share this answer
 
You may read the text file line by line (see "Code: Reading a Text File One Line at a Time (Visual C#)"[^]) until you hit the needed one.
Then you may use the String.Split[^] method to get requested fields.
 
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