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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Batch file question, how to print text files to the screen

Status
Not open for further replies.

nerdhurd2

Technical User
Jul 5, 2005
7
US
Greetings,

is there a way to print text files to a dos window?

What i am trying to do is print screen a text file, then append the output to another text file

print textfile.txt >> appendedfile.txt
print textfile2.txt >> appendedfile.txt


seems like print will just print to a printer

Thanks for any ideas!
 
Use the TYPE command instead of print to list the contents of a text file. You can use the usual operators to redirect output from the screen to another file. If you need it displayed both to the screen and appended to a file, then you'll need to issue the command twice.
 
As kmcferrin suggested...

type testfile1.txt >> appendedfile.txt
type testfile2.txt >> appendedfile.txt

If you want to get fancy, you could do...

Code:
for %%a in ("*.txt") do @type testfile*.txt >> appendedfile.txt

This could potentially put 1000's of files together.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top