extracting data from a text file into an array
im given multiple text files containing student marks and info etc and I need to access these files and extract each type of data such as exam marks student name etc into accessible arrays so I can do calculations on this. So far I have only managed to create a menu to select a file but I dont know how to extract the information from the text files
4 Replies
this is what I have so far
the text files are in this format
Use regex to extract the data. See my temporary repo here https://github.com/suugbut/SuperTrashBin/blob/main/extractor_with_regex.cs
@js
If the structure is consistent, write a simple parser
the simplest kind of parser just uses string splitting and indexof, more or less