![]() |
i ve been trying to find a way to successfully read text files and the be able either to read their data on screen or write their data to another text file.unfortunately i have not achieved yet.could anybody please write me a simple example of java code which reads for example the first,third and fourth line of a text file and another program that reads and writes the same lines to another text file?how can i read the entire file contents?
i am sorry i am asking so many things but i am disappointed and confused.... :( thanks in advance guys :) |
Reading a file's contents: (from http://javaalmanac.com/egs/java.io/R...sFromFile.html)
:
* *try {Read from one file and write to another: (from http://javaalmanac.com/egs/java.io/CopyFile.html?l=new) :
* *// Copies src file to dst file.hope that will help get your started. Note the classes used to read and write. You can find them in the JavaTM 2 Platform, Standard Edition, v 1.4.2 API Specification under java.io |
thank you very much mate!i ll check them out!:)
|
Also, check out the new Scanner class. Much easier for input, in my opinion.
|
| All times are GMT -5. The time now is 8:03 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC