Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
- public class manufactureArray {
- /**
- * @param args
- */
- public static void main(String[] args) {
- Scanner input= null;
- try {
- input = new Scanner(new File("ManufacturersSurveySmallest.txt"));
- } catch (FileNotFoundException e) {
- System.err.println("ERROR - File not found");
- System.exit(1);
- }
- int count=0;
- while (input.hasNextLine()) {
- String text = input.nextLine();
- count ++;
- parser(text, count);
- }
- System.out.println(count+ " records");
- }
- public static void parser (String text, int count){
- String [] state= new String [count];
- String [] geoCode= new String [count];
- String []manuArea= new String [count];
- long [] workWages= new long [count];
- long [] workHours= new long [count];
- Scanner lineScanner = new Scanner (text);
- lineScanner.useDelimiter(":");
- for (int i=1; i<=count; i++){
- state [i]= lineScanner.next();
- geoCode [i]= lineScanner.next();
- manuArea [i]= lineScanner.next();
- workWages [i]= lineScanner.nextLong();
- workHours [i]= lineScanner.nextLong();
- }
- System.out.println(state[1]);
- }
- //public static void hourlyWages(long []workWages, long [] workHours){
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement