Originally Posted by Engineeringserver.com
|
|
You can use the File class to open a file and the scanner class to read it. It isn't that difficult to write a simple text reader.
|
Java Learner,
These other two posters are heavily experienced, I did not try to get this to compile: They can help you with this:
|
Code:
|
import java.io.File;//
import java.io.PrintWriter://
public class FileDemo
{
public static void main(String[] args)
{
// Simple
for(int i= 0;i < args.length;i++)
{
File nextFile = new File(args[i]);
if(nextFile.exists())
{
;// That file already exists.
}
else
{
PrintWriter printWrite
=
new PrintWriter(nextFile);
}
}
} |