Fortran Programming Language
I want to read a file and dump it into another file. I dont need to
read them in any specific way, for my purpose is solely to append it
to another file. Is it possible to do it, without using any loops or
The file essentiallly contains a series of lines containing various
On 5 26 , 9 24 , thinktank <firstname.lastname@example.org> wrote:
just open the file to be append as "append" and write content to it.
> I want to read a file and dump it into another file. I dont need to
> read them in any specific way, for my purpose is solely to append it
> to another file. Is it possible to do it, without using any loops or
> array declarations?.
> The file essentiallly contains a series of lines containing various
If you don't limit the realization to Fortarn, the command "copy" is
well what I meant was that I wanted to read a file from the harddisk
and append it to another file, not append something that is already in
memory. if you have any suggestions do reply
On May 26, 6:46 pm, zyf <email@example.com> wrote:
> The file essentiallly contains a series of lines containing various well, if you were in a Unix environment I would just do cat newstuff
>> oldfile, so I guess you are in windows. Still, with fortran why not something like:
character(len=1000) :: inputline ! Assuming you can specify some max
record size, here 1000
if ( ios /= 0 ) exit ! Likely end of file
OK, this uses loops and declarations, but programs usually do! Luckily
I'm on Linux so I would just use the "cat" method :-)
Yes, the statement of the problem leaves a lot to be desired.
Which platform are you in?
Does it need to be in fortran?
Is this a one time thing?
If you are in unix, you can append like this
cat newStuff >> oldStuff
If you are in Windows, go ahead and open a DOS terminal from Start ->
Programs -> Accessories -> Command Prompt then use the 'copy' command
to copy both files into a third one...they will copied over in the
copy oldStuff newStuff bothStuff
character(30) :: file1, file2, ch*1
read (1,end=101) ch
write (2) ch
@gmail.com> wrote in message
You don't need to write any program.
copy oldfile /A addfile newfile <ret>
This copies the file you want to add ("addfile")to the end of the old
file ("oldfile" (ASSUMING ASCII LINES, else take away the /A) and
creates a new ascii file "newfile" with both inside in the order
On May 26, 10:30 pm, gsal <firstname.lastname@example.org> wrote:
copy file1+file2 newFile
is a little more intuitive...
In a previous article, dpb <email@example.com> wrote:
.. and re. windows/DOS/commandline, if they
not ascii files then use "copy/b ... "
Would the command:
TYPE FILE1.TXT >> FILE2.TXT from a DOS session work for you?
It would append FILE1.TXT to the end of FILE2.TXT
Does your FORTRAN supports a SYSTEM("TYPE FILE1.TXT >> FILE2.TXT") call?
or perhaps SYSTEM("cat file1.txt >> file2.txt") for a *NIX type system?
@gmail.com> wrote in message