c# - Get variables from text File -


i have text file each item in <> , sepperated , there no spaces.

i need able read total number of records , asign variable.

also need asign each item in row variable , number of row variable. can processed later.

i have search internet seem going in circles, or source ideas appriciated.

instructions not clear, give try.

    using system;     using system.data;     using system.io;     using system.collections.generic;  class test {     public dictionary<int, string> readandsortfile()     {         streamreader sr = new streamreader("file.txt");         dictionary<int, string> dic = new dictionary<int, string>();          int loop = 0;         while (!sr.endofstream)         {             dic.add(loop, sr.readline());             loop++;         }         sr.close();          return dic;     } } 

your result should this:

[0] {[0, <a>]}   [1] {[1, <b>]} [2] {[2, <c>]}   

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -