import java.util.*;
import java.io.*;

public class ManageCars {
  
  public static Automobile processLine(String text) {
    Scanner data = new Scanner(text);
    data.useDelimiter(",");   // scanner delimited by comma
    String vin = data.next();
    String make= data.next();
    String model = data.next();
    System.out.println("model = " + model);
    int year = data.nextInt();
    Automobile car = new Automobile(make, model, year, vin);
    return car;
  }
  public static void main(String[] args) 
    throws FileNotFoundException {
    Scanner input = new Scanner(new File("inventory.dat"));
    while (input.hasNextLine()) {
      String textLine = input.nextLine();
      Automobile car = processLine(textLine);
      System.out.println("inventory car: " + car);
    }
  }
  
}
