[fortran90] arrange value in row into column

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
s_hy
Messages
57
Reaction score
0
I have a data file, let's say test.dat which is contain [1 2 3 4 5 6 7...3000]. the question is how can I re-arrange this data from a row into a column so that I will have a set of data like this
1
2
3
4
5
6
7
.
.
.
3000

in fortran90 or MATLAB also will be okay.

thank you
 
on Phys.org
I don't understand what you are trying to do. In Fortran, there is no distinction between a row vector and a column vector. A 1D array is just a 1D array.
 
Also, the data in a file is not arranged in rows or columns. It's a sequence of numbers (binary file) or characters (text file). There can also be non-printing characters such as tab, newline, and other control characters.