messages.setDateFormat(factory.constructDateFormat());
try {
System.out.println("Reading messages from " + inputCSVFile);
InputStream inputCSV = new FileInputStream(inputCSVFile);
messages.load(inputCSV);
inputCSV.close();
} catch (FileNotFoundException e) {
System.err.println("Input CSV file " + inputCSVFile + " not found.");
System.exit(1);
} catch (InvalidObjectException e) {