View previous topic :: View next topic |
Author |
Message |
pban92
Joined: 23 Nov 2009 Posts: 38
|
Posted: Thu Nov 26, 2009 12:51 pm Post subject: READ 'specific' column |
|
|
How to read any specific column from an external file having several columns?
For example, I can read all the three columns by following command:
DO i = 1, n
READ (3,*,IOSTAT=ierr) x(i), y(i), z(i)
END DO
But I understand this wastes the memory if I need only one column, say y(i) or z(i).
Thanks in advance! |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Thu Nov 26, 2009 1:53 pm Post subject: |
|
|
Code: | DO i = 1, n
READ (3,*,IOSTAT=ierr) xdummy, y(i), zdummy
END DO |
|
|
Back to top |
|
|
pban92
Joined: 23 Nov 2009 Posts: 38
|
Posted: Thu Nov 26, 2009 1:58 pm Post subject: |
|
|
Thanks a lot John! |
|
Back to top |
|
|
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: Nürnberg, Germany
|
Posted: Thu Nov 26, 2009 2:12 pm Post subject: |
|
|
Only a comment: We usualy use void for such "place holders" but this is of course our internal arrangement |
|
Back to top |
|
|
|