forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

READ 'specific' column

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
pban92



Joined: 23 Nov 2009
Posts: 38

PostPosted: Thu Nov 26, 2009 12:51 pm    Post subject: READ 'specific' column Reply with quote

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
View user's profile Send private message
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Thu Nov 26, 2009 1:53 pm    Post subject: Reply with quote

Code:
DO i = 1, n
READ (3,*,IOSTAT=ierr) xdummy, y(i), zdummy
END DO
Back to top
View user's profile Send private message Visit poster's website
pban92



Joined: 23 Nov 2009
Posts: 38

PostPosted: Thu Nov 26, 2009 1:58 pm    Post subject: Reply with quote

Thanks a lot John!
Back to top
View user's profile Send private message
jjgermis



Joined: 21 Jun 2006
Posts: 404
Location: Nürnberg, Germany

PostPosted: Thu Nov 26, 2009 2:12 pm    Post subject: Reply with quote

Only a comment: We usualy use void for such "place holders" but this is of course our internal arrangement Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group