May-03-2018, 05:21 AM
Hello, welcome to Python and the forums!
It is advisable that instead of using "open" on its own, you use the "with" statement (so-called context manager). You can read about that and how to handle files in the official docs, as well as numerous other sources available online for free.
You will probably want to loop through the file and read each line as a string. Some string methods will come handy, for example splitting the text. After that you will probably be best off saving the read data in a dictionary, or dictionaries.
If you get stuck feel free to post your attempt and explain what the problem is or what the desire result would be compared to actual one.
It is advisable that instead of using "open" on its own, you use the "with" statement (so-called context manager). You can read about that and how to handle files in the official docs, as well as numerous other sources available online for free.
You will probably want to loop through the file and read each line as a string. Some string methods will come handy, for example splitting the text. After that you will probably be best off saving the read data in a dictionary, or dictionaries.
If you get stuck feel free to post your attempt and explain what the problem is or what the desire result would be compared to actual one.