public void parse(){

		for (int i = 0; i < files.size(); ++i){

			File f = files.get(i);

			if (f.canRead()){
				try {

					BufferedReader reader = Files.newBufferedReader(f.toPath(), Charset.forName("US-ASCII"));
					String line = null;

					String name = f.getName();
					name = name.replace(".csv", "");
					String[] tmp = name.split("-");

					if (tmp.length < 3){
						Console.warn("Skipping file that does not match the correct filename format. (" + f.getName() + ")");
						continue;
					}

					//Parse name.
					short part = Short.parseShort(tmp[0]);
					String cond = tmp[1].replaceAll("\\d+", "");
					short version = Short.parseShort(tmp[1].replaceAll("[a-zA-Z]+", ""));
					String block = tmp[2];
					AutoCAMSData d = new AutoCAMSData(part, cond, version, block);

					//Parse lines
					while ((line = reader.readLine()) != null){
						if (line.startsWith("#")) continue;

						String[] parts = line.split(",");

						d.injestLine(parts);

					}

					//Add data object to output. Failed parses won't make it here.
					data.add(d);

				} catch (IOException e) {
					Console.warn("An error occured in file: " + f.getPath() + "! File skipped.");
					Console.error(e.getMessage());
					e.printStackTrace();
				} catch (NumberFormatException | ParseException e){
					Console.warn("A parsing error occured parsing " + f.getPath() + ". The file must be skipped.");
					Console.error(e.getMessage());
				}
			} else {
				Console.warn("Can't read: " + f.getPath() + "! Skipping.");
			}

			updateProgress(i, files.size());
			updateMessage("Parsing file " + i + "/" + files.size());

		}

	}