Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

how to open list of files
Hello,
I would like to know if there is a way to open a list of files
and read them. examples like file a b c d ,...  and read values of x,y
in them


Report this thread to moderator Post Follow-up to this message
Old Post
wiggy13
05-18-05 09:01 AM


Re: how to open list of files
wiggy13 wrote:
> Hello,
>         I would like to know if there is a way to open a list of
files
> and read them. examples like file a b c d ,...  and read values of
x,y
> in them

You can store the list of file names in a file and then have your
program read the file names and then open them. In my programs, the
input files are usually in the same directory and share the same
suffix, so the full file names can be constructed from the directory
name, prefix, and suffix using the // operator and the TRIM function.

Do all the files need to be open at the same time? I think compilers
limit the number of files that can be open at one time.


Report this thread to moderator Post Follow-up to this message
Old Post
beliavsky@aol.com
05-18-05 09:01 AM


Re: how to open list of files
Hi,
How do you do that? Let say I got files like acx-800.txt,
acx-801.txt, ...
all this are consists of  x and y data in them. Usually I read each by
acx-800.txt
usually i compile by f77 prog.f
then it a.out
when I try a.out
I enter infile and return

How do u try to "a.out infile" in one line and return
I'm still new at this

 ****************************************
************************************
*****

read (*, '(a80)') infile
lun = 10
open (unit=lun, file = infile,
1  form = 'formatted', status = 'old')
i = 0
ios = 0
do while ( ios .eq. 0 )
read (lun, fmt = '(a80)', iostat = ios) line
if (ios .eq. 0 .and. line(1:1) .ne. '"') then
i = i + 1
read (line, *) x(i),y(i)
endif
end do
close (lun)


Report this thread to moderator Post Follow-up to this message
Old Post
wiggy13
05-18-05 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:11 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.