Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SECTION_A 256
- SECTION_B 344
- SECTION_C 556
- Dictionary<string, int> sectionIndex = new Dictionary<string, int>();
- List<string> headers = new List<string>(); // fill these with readline
- foreach(string header in headers) {
- var s = header.Split(new[]{' '});
- sectionIndex.Add(s[0], Int32.Parse(s[1]));
- }
- Dictionary<string, int> sectionIndex = new Dictionary<string, int>();
- List<string> headers = new List<string>(); // fill these with readline
- foreach(string header in headers) {
- var s = header.Split(new[]{' '});
- sectionIndex.Add(s[0], Int32.Parse(s[1]));
- }
- Dictionary<string, int> sectionIndex = new Dictionary<string, int>();
- List<string> headers = new List<string>(); // fill these with readline
- foreach(string header in headers) {
- var s = header.Split(new[]{' '});
- sectionIndex.Add(s[0], Int32.Parse(s[1]));
- }
- Dictionary<string, int> sectionIndex = new Dictionary<string, int>();
- List<string> headers = new List<string>(); // fill these with readline
- foreach(string header in headers) {
- var s = header.Split(new[]{' '});
- sectionIndex.Add(s[0], Int32.Parse(s[1]));
- }
- string dataRow = "";
- try
- {
- TextReader tr = new StreamReader("filename.txt");
- while (true)
- {
- dataRow = tr.ReadLine();
- if (dataRow.Substring(1, 8) != "SECTION_")
- break;
- else
- //Parse line for section code and line number and log values
- continue;
- }
- tr.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
Add Comment
Please, Sign In to add comment