I am currently trying to format outputs from a fortran code into CSV using the textscan function in Matlab. My outputs from the fortran code have a semi-uniform output, but it can change depends on the number of nodes the user requests.
In this example, the user has specified 12 nodes and the text files looks like the following:
Interpolated values at stations
867600.0000000000 % this is the time step at which the values at the following 12 nodes is found.
Currently, I have textscan skipping the first two lines. My final output goal would looks somethign like the following:
timestep 1, node 1, node 2, ..., node 11, node 12
timestep 2, node 1, node 2, ..., node 11, node 12
Currently, I would like the code to be smart enough to tell the number of nodes that the user supplied (provided in the second line of the above text), and also be able to distinguish between the timestep lines and the node lines.
I've attached a example of one of my text files.