Reading a specific column from .csv into fortran

In summary, a .csv file is a type of text file that stores data in a table format, separated by commas and new lines. To read a specific column from a .csv file in Fortran, you can use the "OPEN" statement with the "DELIM=" option and the "READ" statement with the "INTENT(IN)" attribute. The data is typically stored as character strings and may need to be converted using functions. Multiple columns can be read using a loop or array, and missing or invalid data can be handled using the "IOSTAT" option and conditional statements or the "NULL" keyword.
  • #1
1
0
Hi, I am using fortran to read specific columns from a .csv file. the rows in each columns are different, so I wish to read columns wise with a do loop. say, I wish to read from A1 to D20 initially(4 columns of 20 rows), then later f1 to h35 (3 columns, 35 rows). how do I read particular columns alone. thanks
 
Technology news on Phys.org
  • #3
jedishrfu said:
You have to read all columns and pick the one you want.

True, but only one of them has to be an array.
 
  • Like
Likes jedishrfu

Suggested for: Reading a specific column from .csv into fortran

Replies
9
Views
2K
Replies
12
Views
2K
Replies
34
Views
2K
Replies
14
Views
4K
Replies
4
Views
371
Replies
1
Views
802
Replies
1
Views
302
Replies
2
Views
820
Replies
8
Views
1K
Replies
12
Views
897
Back
Top