Here's a look at the function that I'm messing up for a day. For some reasons it writes the last value in the CSV in opposition to parsing it through rows. I threw it in some print statements and it appears that the line content is writing properly on the array, but the help being written by the last value is wonderful, thanks.
public int csvCombine (ArrayList & lt; indexstruct; nowadays csv, integer kollkow, string date) iOException {string rows = zero; Index temp list = new index (); String [] linear = new string [2]; FileReader fr = New FileReader (date + ".csv"); Buffett reader BR = new buffed reader (FR); Rows = br.readLine (); RowArray = rows.split (","); Totalconvo + = integer.parseInt (rowArray [0]); The reader reads / reads the total amount of words and it is added to the CSV value of the spoken words, the final integer csvSize = integer. Paracetre (linear [1]); Read the size of csvList for // (integer number = 0; calculation & lt; csvSize-1; calculation ++) {rows = br.readline (); Linear = ras.plit (","); // read lines in an array, assumes array and places them in a type of index structure to write them in aerialist templales. NumOfUses = integer. Parasent (linear array [1]); // Set Object using tem templist.Word = rowArray [0]; // set object word todays csv.ed (count, tempelist); // csv adds an object to ArrayList} br.close (); Total return; }
Adding the same tempered object that you are currently doing , And therefore it makes sense that all the data is identical with each repetition of the loop, you need to create a new template object (whatever type it is).
i.e.,
for (int count = 0; count & lt; csvSize-1; count ++) {rows = br.readline (); Linear = ras.plit (","); Int useCount = Integer.parseInt (linear [1]); String word = row ray [0]; // is considered to be a type of model that is called a template with a constructor, which looks like CSV.ed to date (counting, new templist (user count, word)); }
No comments:
Post a Comment