Adding line numbers to code in output file
okay so here is my problem:
The program should ask the user for input and output file names. The program should read the input file, add line numbers and write the result to the output file. Set a field width for the line number to 5. The line number should be followed by a semicolon and a space.
Okay so far i think i need to have a scanner get the input from the user of the file name and import a java.io and check for the files existence using
file file = new file("FilesName");
then an if statement
then open the file using the scanner.
Now this is where my problem begins more than before, i dont know how i would go about placing the numbers in the code and placing it in an output file?