Excel data used in Java? -


i made randomly generated list of people names, ages, weight, height, etc. in excel. know how can use information in excel create "person" in java each file contain information of each person created in excel. there 200,000 "people". example java template: "name = [insert excel cell a1]" goes "age = [insert excel cell a2]" , first row saves file , uses empty variable template again , 200,000 individuals. possible or have hand? can automated?

you can use opencsv convert each row bean. need save excel csv file.

csvreader reader = new csvreader(new filereader("yourfile.csv"));  columnpositionmappingstrategy strat = new columnpositionmappingstrategy(); strat.settype(person.class);  // fields bind in javabean string[] columns = new string[] {"name", "age"};  strat.setcolumnmapping(columns);  csvtobean csv = new csvtobean(); list list = csv.parse(strat, reader); // people 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -