简体   繁体   中英

java file reading and storing it in a hashmap <String,ArrayList> and comparing with other hashMap

For sample data : Column1,Column2,Column3 1,abc,P 1,abc2,P 1,abc3,P 2,qqq,L 2,uuuu,L

So for all column1 with same value its corresponding column3 should be having same value, but it could possible that column1 and column3 not having same value.

Eg column 1 having value 0-7 is occuring 10 times, now its corresponding column 3 having value 16 is also occuring 10 times on same elements of column2 . so this need to be verified on large data set.

Wanted to implement it through java, so what I trying to do create a HashMap with and then adding it for one value set, and in arraylist will add values of column2 having same corrrsponding column1 value. similarly this will be done for column3 and column2, and then compare two hashmaps for the distinct keys of colum1,cloumn3 - is that correct appraoch ?

If you are trying to manipulate a xls you should use http://mvnrepository.com/artifact/org.apache.poi/poi/3.7

It's really hard to understand that. But I guess you what to use unique entries and count than or not. So use:http://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html

and

/HashMap.html

hope it helps to guide your ideas.

ps: the more complex your solution, the more seems to be the wrong approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM