| | |
beginners problem - files
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 39
Reputation:
Solved Threads: 4
huh?
I'm gonna guess what the heck you mean here, and hand you an answer.
I'm gonna guess what the heck you mean here, and hand you an answer.
C# Syntax (Toggle Plain Text)
List<string> a = new List<string>(); List<string> b = new List<string>(); using ( StreamReader reader = new StreamReader(File.OpenRead(FILE_PATH)) ) { string line = null; string[ ] parts = null; try { while ( (line = reader.ReadLine()) != null ) { if ( String.IsNullOrEmpty(line) ) continue; parts = line.Split(new char[ ] { '\t' }, StringSplitOptions.RemoveEmptyEntries); if ( parts.Length >= 1 ) { a.Add(parts[0]); if ( parts.Length >= 2 ) { b.Add(parts[1]); } } } } catch ( Exception exception ) { throw exception; } finally { reader.Close(); } }
![]() |
Similar Threads
- C++ Books (C++)
- I have a form problem (HTML and CSS)
- New To Linux? Not a Computer Genius? CLick->Here<-For Some Useful Info. (Getting Started and Choosing a Distro)
- Prog to list ASCII codes (beginners' stuff) (C)
Other Threads in the C# Forum
- Previous Thread: Windows application on a server
- Next Thread: How to protect my exe file in cd?
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development dll draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser wia windows winforms wpf xml





