Cannot read file into array list java -
my program saves doubles in txt file read later arraylist. here code
string missratiopathname = "/users/tomfinet/desktop/cache_experiment_miss_ratio_data.txt"; bufferedreader missratioinput = new bufferedreader(new filereader( new file(missratiopathname))); string missratioline; while ((missratioline = missratioinput.readline()) != null) { if (!(missratioline.trim().indexof("0") == 0) || (missratioline.trim().indexof(" ") == 0) || (missratioline.isempty())) { string rawdata = missratioline.split("\n")[0]; if (!rawdata.equals("")) missratiodata.add(double.parsedouble(rawdata)); } }
here text file, every line in text file should added array double.
0.9932 0.98792 0.9806 0.97508 0.96796 0.9608 0.95704 0.95056 0.94284 0.93464 0.93028 0.92472 0.91952
when run program none of these lines added missratiodata
arraylist because line of code never reached.
how can fix this?
Comments
Post a Comment