Basically, I was wondering how I could read a text file (Transactions.txt) which will have one
number per line(ex. 2000 on one line, 25 on another). This number is either a deposit or a withdrawal to a checking account. The program should read the Transactions.txt , then write the deposits (positive numbers) to an output file named Deposits.txt and the withdrawals (negative numbers) to an output file named Withdrawals.txt. Each number should be displayed on the screen as it is read from the file. I have figured out how to read the Transaction file and display the first line, but I'm not sure from there.
public static void main(String[] args) throws IOException
{
//Open the file.
File file = new File("Transactions.txt");
Scanner inputFile = new Scanner(file);
//Read the first line from the file.
String line = inputFile.nextLine();
//Display the line.
System.out.println("The first line in the file is:");
System.out.println(line);
//Close the file.
inputFile.close();