FileDataModel accepts data in the format
userId,itemId,pref(long,long,Double).
At the moment I have some itemId that consist of an 'x' at the end of the number. How do I edit the some of the itemID such that it removes the 'x' ? Is it possible to do this with a simple try catch statement?
DataModel model = null;
try{
model = new FileDataModel(new File("book_data/BX-Book-Ratings.csv"));
}catch(NumberFormatException e){
REMOVE X
}
CODE:
DataModel model = new FileDataModel(new File("book_data/BX-Book-Ratings.csv"));
ERROR:
Exception in thread "main" java.lang.NumberFormatException: For input string: "034545104X"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
DATA:
276725,034545104X,0
276726,155061224,5
276727,446520802,0
276729,052165615X,3