Solved

Easy one...

Posted on 2000-05-12
4
210 Views
Last Modified: 2010-04-02
The question is not much about c++.

In console mode under win9x,sometimes I run an executable which will print many information in the DOS-like console window.The problem is the information always longer than one screen,so when the printing ends,I can only see the last screen of all things got printed.
How to read it screen by screen,or to write it to a file to read all it prints to console window?

Any advice is great!
Thank you
0
Comment
Question by:geeboy
4 Comments
 
LVL 1

Expert Comment

by:mournblade
ID: 2805730
<program> > outputfile.txt

e.g. dir > dir.txt

it would put the result you see on standard output (the screen) in the dir.txt file
0
 

Expert Comment

by:rgough
ID: 2805870
.. or pipe it through the "more" command:

e.g. dir | more

will send a page worth of output to the console at a time.
0
 
LVL 1

Expert Comment

by:zoushen
ID: 2807787
 

  U can try ***.exe > record.txt

or like ***.exe >> record.txt


but such ways would not succeed every
time.


for more help , you should study some
old dos commands  .
0
 
LVL 6

Accepted Solution

by:
Talmash earned 50 total points
ID: 2808096
hi ,
try one of these :

file_name > text_file.txt

*** such command change the standard output from the screen to the file you gave its name after the ">" sign .

As I understood you run over PC station using Dos shell (screen) ,

if you're using linux/unix shell you can write just the same as above or use the pipe tool (more or + in most environments )

file_name | more
or
file_name | +


regards ,

Talmash
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question