I've a very simple question: which is the most efficient way to read different entries from a txt file with Python?
Suppose I've a text file like:
42017 360940084.621356 21.00 09/06/2015 13:08:04
42017 360941465.680841 29.00 09/06/2015 13:31:05
42017 360948446.517761 16.00 09/06/2015 15:27:26
42049 361133954.539315 31.00 11/06/2015 18:59:14
42062 361208584.222483 10.00 12/06/2015 15:43:04
42068 361256740.238150 19.00 13/06/2015 05:05:40
In C I would do:
while(fscanf(file_name, "%d %lf %f %d/%d/%d %d:%d:%d", &id, &t0, &score, &day, &month, &year, &hour, &minute, &second) != EOF){...some instruction...}
What would be the best way to do something like this in Python? In order to store every value into a different variable (since I've got to work with those variables throughout the code).
Thanks in advance!