read certain rows txt file
Hello everyone, I wanted to know how I can recover files txt certain lines. I'm doing a library (office) where entering a string as a parameter I must return all that is written on the same line. How can I do this?
public void loadInfo(T info) { using (StreamReader sr = File.OpenText(path)) { if() } }
Comment
Answer by gjf · Nov 07, 2015 at 11:08 PM
read the file into an array, separated by whatever line separator your file is using then evaluate the parameter to use as an index into that array.
however, since this isn't unity specific, you'd be better off asking somewhere like stackoverflow.com