"bn***@hotmail-dot-com.no-spam.invalid (slickn_sly)" wrote in comp.lang.java:
How do you read a .txt file and have the compiler print out what's in
the text file?
If you're using an Operating System that has a DOS prompt, you can do
the following to get your compiler to print (I'll assume your printer is
connected to LPT1:):
JavaC filename.txt | sort > lpt1.dos
Depending on the contents of your text file, the output, which although
will be sorted alphabetically, will probably be quite different from the
original contents of the text file.
You'd probably be better off using the following:
Type filename.txt | sort > lpt1.dos
Of course, in both of these examples the Java Compiler isn't actually
doing the printing -- your Operating System is, but it's more likely that you
meant that the output should be sent to the printer.
--
Randolf Richardson, pro-active spam fighter -
rr@8x.ca
Vancouver, British Columbia, Canada
Sending eMail to other SMTP servers is a privilege.