Skip to content

Basic utility in Java that reads both XLSX, XLS and CSV files and converts Excel rows to Java Objects.

Notifications You must be signed in to change notification settings

chinmaychotaray/excelr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

excelr

Basic utility in Java that reads both XLSX, XLS and CSV files and converts Excel rows to Java Objects. It uses Apache POI and OpenCSV for reading Excel files.

Usage example:

	RowConverter<Country> converter = (Object[] row) -> new Country((String)row[0], (String)row[1]);
	
	ExcelReader<Country> reader = ExcelReader.builder(Country.class)
	     .converter(converter)
	     .withHeader()
	     .csvDelimiter(';')
	     .sheets(1)
	     .build();
	
	List<Country> list;
	list = reader.read("src/test/resources/CountryCodes.xlsx");
	list = reader.read("src/test/resources/CountryCodes.xls");
	list = reader.read("src/test/resources/CountryCodes.csv");

Excel File:

	Code	Country
	ad	Andorra
	ae	United Arab Emirates
	af	Afghanistan
	ag	Antigua and Barbuda
	...

Country Class:

public static class Country {
	public String shortCode;
	public String name;

	public Country(String shortCode, String name) {
		this.shortCode = shortCode;
		this.name = name;
	}
}

About

Basic utility in Java that reads both XLSX, XLS and CSV files and converts Excel rows to Java Objects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%