PDA

View Full Version : How to read the name of a series of files in LINUX or FEDORA ?



himansu
16th January 2009, 05:06 PM
How to read the name of a series of files in LINUX or FEDORA ?
if possible give an example:confused:

vinu
17th January 2009, 04:18 AM
Did you mean using a shell-script?
http://parallel.vub.ac.be/documentation/linux/unixdoc_download/Scripts.html

This might help if you are into writing shell scripts.

-Vinu

himansu
19th January 2009, 01:14 PM
Did you mean using a shell-script?
http://parallel.vub.ac.be/documentation/linux/unixdoc_download/Scripts.html

This might help if you are into writing shell scripts.

-Vinu
Actually, i want to create multiple files using fortran and that to using linux or fedora.

e.g
> i want to create file names like "march-11.dat,march-12.dat,march-13.dat................etc" in this manner(since i have to store data separately corresponding to it)

> since we find that their r variables as 11,12,13,14,15 ....in our file names.

> can we use do loop to create files in a single run.?

please help.

vinu
20th January 2009, 11:04 AM
Hi Himansu,

I am not sure whether I understood your question completely.

If you want to create multiple data files in Fortran, the following might help you.

Example
-----------

character*12 my_file_name
do loop=1,12
write(my_file_name,'(a,i2.2,a)')'march-',loop,'.dat'
write(*,*) my_file_name

open (1, file=my_file_name)
! your operations here
write (1,*) ! write your data as you want
close (1)

enddo
end

This will help you to create march-01.dat to march-12.dat files within
the fortran.


-Vinu