| | |
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 ado.net algorithm api array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime decryption degrees development drag draganddrop drawing encryption enum event excel file form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label list listbox mandelbrot marshalbyrefobject math mouseclick mysql netcfsvcutil.exe numeric operator path photoshop php picturebox pixelinversion platform polynomial post programming radians regex remote remoting richtextbox serialization server sleep socket sql statistics stream string study table text textbox thread time timer update usb usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml





