I need to process a BIG text file that contains space-separated float numbers in ASCII representation:
1.0012 0.63 18.201 -0.7911 92.2869 ...
How do I read these numbers one-by-one (not entire file and not line-by-line) using built-in Python tools? As sample, the C source code to solve this task looks like:
float number;
FILE *f = fopen ("bigfile.txt", "rt");
while (!feof (f)) {
fscanf (f, "%f", &number);
/* ... processing the number here ... */
}
fclose (f);