Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileWriter;
- import java.io.PrintWriter;
- import java.util.Scanner;
- /**
- * Created by Bryan on 2/25/2015.
- */
- public class A19005B
- {
- public static void main(String[] args)throws Exception
- {
- //declare variables
- //open input file
- File myFile = new File("data/FBIN.txt");
- Scanner inputFile = new Scanner(myFile);
- //open output file
- FileWriter fWriter = new FileWriter("data/output.txt", true);
- PrintWriter outFile = new PrintWriter(fWriter);
- for(int i = 0; i < 7; i++)
- {
- inputFile.nextLine();
- }
- //loop through input file
- while (inputFile.hasNext())
- {
- String strRecord = inputFile.nextLine() + " ";
- if(strRecord.length() > 65)
- {
- //instantiate NWSFB
- NWSFB fb = new NWSFB(strRecord);
- //write to outputfile
- outFile.println(fb.fmtWeatherReport());
- }
- //close loop
- }
- //close files
- inputFile.close();
- outFile.close();
- fWriter.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement