Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program output from CMD to file

Status
Not open for further replies.

Matthieu123

Technical User
Aug 20, 2009
2
NL
Hi all,

I'm running a executable of my fortran program to calculate waves in the coastal zone.
It outputs every timestep log info to the screen about its status.
Is there an easy way to save all the text (even if it is not visible anymore) in the cmd?
It writes down quite some things to the screen and I don't want to add an extra write format for a log file to every write (*.*) command in all the routines.

Thanks in advance!!

Matthieu
 
Hi Matthieu123

If you are using Windows, try to go to the DOS wiew by using the Command prompt. Go to the directory where the program is and then run the program with "> out.txt" after the program name. If the program name is for instance "aaa", then type:

aaa > out.txt

And all that is usually written on the screen is now written into the out.txt file.
 
Thanks gullipe!

That is what I need!
Now I can see what my computer has been doing overnight.

Is there also a way to have both the output written to the file and the screen?

Cheers,

Matthieu
 
Hi Matthieu123

No, unless you have an access to the code (and a compiler) and change the program to write all output to both the screen and a file.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top