Also, there
are examples on the Fortran Wiki related to this topic, including one that uses basic built-in Fortran
features:
https://fortranwiki.org/fortran/show/getvals
and readling lines of arbitrary length if that is really a problem instead of readling a line of some longer-than needed length like 1024 characters, etc. is in
https://fortranwiki.org/fortran/show/readline
If you use fpm there are several procedures for just that purpose such as s2vs() in
which is also available along with several similiar procedures in the simpler M_strings module as
well.
an example of a file (just number and whitespace or commas, semi-colons, …; all integers or floats as well, … would be useful if there are any known file attributes.