Need to read in from a file. That file is a list of information like a name then next line can be a number. I need to take that info a output it into a file. So here i have the code to get the two file names but im starting to do the reading of the input file and it looks very wrong. I need to do a loop i think, how can i loop this to make it read in both strings and ints(I know the order). I still need to output it into a formatted way in the outfile but this loop is confusing me.
import java.io.FileReader; import java.util.Scanner; public class Standalonereport { public static void main(String[] args) { String fileName; String outFile; Scanner keyboardScanner = new Scanner(System.in); System.out.printf("Enter the file name: "); fileName = keyboardScanner.next(); System.out.printf("Enter the output file name: "); outFile = keyboardScanner.next(); //WORKING UP TO THIS POINT Scanner inputScanner; inputScanner = new Scanner(new FileReader(fileName)); String s; s = inputScanner.nextLine();