public static void main(String args[]) {

        Inventory inventory = new Inventory();
        String outputString = "";  //To hold the String returned by the Inventory readFile method 

        //If a file was passed by command-line, use it to populate data
        if (args.length != 0) {
            outputString = inventory.readFile(args[0]);
        } //If the file "hw1in.txt" exists in the working directory
        else if (new File("hw1in.txt").exists()) {
            outputString = inventory.readFile("hw1in.txt");
        } //If no file was given by command line, and file can't be found in the
        //working directory, prompt user for file using JFileChooser
        else {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setCurrentDirectory(new File("C:\\"));
            fileChooser.setMultiSelectionEnabled(false);  //allow selection of only one file
            int ret = fileChooser.showDialog(null, "Select Warehouse Data");

            if (ret == JFileChooser.APPROVE_OPTION) {
                File warehouseDataFile = fileChooser.getSelectedFile();
                outputString = inventory.readFile(warehouseDataFile.getPath());
            }
        }

        //After file had been processed and string returned by the Inventoty class
        //print the string to a file
        PrintWriter output;
        try {
            output = new PrintWriter(new File("hw1out.txt"));
            output.print(outputString);
            //print buffered data to file
            output.flush();
            //close the file
            output.close();
        } catch (java.io.FileNotFoundException ex) {
            System.err.println("File not found.");
        }
    }