[SOLVED]Problem with string parsing.
I am working on a project for school where we need to open zip file, read content of each file within zip (which are all text files) and parse string from those files. I need to isolate name and integer corresponding to each name. I will paste code now here, and then tell you what is the problem.
The program throws an NumberFormatException. Now, I know what the problem is, but I can't figure out why or how to fix it. Integer.ParseInt() tries to convert a string that does not have the appropriate format. I'm guessing the problem is with delimiters. Text in the file looks consistent. I will attach exact text file I am testing on. If someone would please test this for me and point me in the right direction for solving this problem.
public class StringParser
private final int NAME_INDEX = 0;
private final int WEIGHT_INDEX = 2;
private String inputLine = "";
private String name = "";
private int weight;
public StringParser(String zipReadList)
inputLine = zipReadList;
public void parseString()
Scanner input = new Scanner(inputLine).useDelimiter("\n");
String temp = input.next();
String splitInputLine = temp.split(",");
name = splitInputLine[NAME_INDEX];
weight = Integer.parseInt(splitInputLine[WEIGHT_INDEX]);
System.out.println(name + " " + weight);
catch (NumberFormatException e)