How to parse a text file with C#

后端 未结 7 1934
面向向阳花
面向向阳花 2020-12-08 14:57

By text formatting I meant something more complicated.

At first I began manually adding the 5000 lines from the text file I\'m asking this question for,into my proje

7条回答
  •  渐次进展
    2020-12-08 15:14

    You could open the file up and use StreamReader.ReadLine to read the file in line-by-line. Then you can use String.Split to break each line into pieces (use a \t delimiter) to extract the second number.

    As the number of items is different you would need to search the string for the pattern 'item\*.ddj'.

    To delete an item you could (for example) keep all of the file's contents in memory and write out a new file when the user clicks 'Save'.

提交回复
热议问题