public static void readFile(String filePath) {

		lineCode lineType = lineCode.amount;
		try {

			FileInputStream fstream = new FileInputStream(filePath);
			DataInputStream in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String strLine;

			while ((strLine = br.readLine()) != null) {
				if (noOfCases == 0) {
					noOfCases = Integer.parseInt(strLine);
					creditList = new ArrayList<Integer>(noOfCases);
					noOfitemList = new ArrayList<Integer>(noOfCases);
				} else {
					if (lineType == lineCode.amount) {
						creditList.add(Integer.parseInt(strLine));
						lineType = lineCode.noOfItems;
					} else if (lineType == lineCode.noOfItems) {
						noOfitemList.add(Integer.parseInt(strLine));
						lineType = lineCode.items;
					} else if (lineType == lineCode.items) {
						String string = strLine;
						String[] itemInt = string.split(" ");
						for (String itemString : itemInt) {
							itemslist.add(Integer.parseInt(itemString));
						}
						lineType = lineCode.amount;
					}

				}
			}

			in.close();

		} catch (Exception e) {
			System.err.println("Error: " + e.getMessage());
		}
	}