C
C#3y ago
LukeZurg22

Data Reading Suggestion

Good afternoon, I have a text file filled with data that I am not meant to directly change. I need to read this file as efficiently as possible; are there any suggested methods?
5 Replies
Pobiega
Pobiega3y ago
Open it in read only mode for one. It seems to be about 129 kb, which is very small so no problem to just straight serialize it from the stream
LukeZurg22
LukeZurg22OP3y ago
So you could say something like such would work:
using (TextReader reader
= new StreamReader(File.OpenRead(Path.Combine(->filepath<-, "cultures.txt"))))
{
//Culture reading
}
using (TextReader reader
= new StreamReader(File.OpenRead(Path.Combine(->filepath<-, "cultures.txt"))))
{
//Culture reading
}
However; any recommendations on reading the properties of the file specifically? (culture name, first names thereof, last names thereof, etc.) I should have been a bit more clear.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
LukeZurg22
LukeZurg22OP3y ago
Yes, I indeed would be reading line by line. I could set up a tedious series of checks to find out which part of a line it is on, but I wanted to make sure if there was a better way to read between {}
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server