reading in missing data c# input string was not in a correct format -
i new c#. have been trying read in dataset missing data. after reading in headers, read in rest of file using:
list<int> idlist = new list<int>(); list<int[]> vallist = new list<int[]>(); string line = sr.readline(); while (line != null) { string[] lineparts = line.split(delimiters); int id = convert.toint32(lineparts[0]); idlist.add(id); int[] vals = new int[numtests]; (int = 0; < numtests; i++) { vals[i] = convert.toint32(lineparts[i + 1]); } vallist.add(vals); line = sr.readline(); } childids = idlist.toarray(); int[][] values = vallist.toarray();
when run this, error message "input string not in right format." can't quite figure out how read in missing data. suggestions? thanks
"input string not in right format" means you're trying parse int nonsense string.
for example:
convert.toint32("the letter q"); // throw exception.
c# string input missing-data
No comments:
Post a Comment