<file_sep>package nl.timverwaal.labelformatter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class AddressesExcelSheet {

	private ArrayList<Address> addressesList = new ArrayList<Address>();

	public AddressesExcelSheet(String excelFilePath, Integer sheetNumber) throws IOException {

		FileInputStream inputStream = new FileInputStream(new File(excelFilePath));

		Workbook workbook = new XSSFWorkbook(inputStream);

		Sheet addressSheet = workbook.getSheetAt(sheetNumber);		

		Row row;
		Cell cell;
		Address address;

		for(int rowIndex=1; rowIndex < addressSheet.getLastRowNum(); rowIndex++){

			row = addressSheet.getRow(rowIndex);
			if (row == null) continue ;

			cell = row.getCell(1);
			if (cell == null) continue;        	
			if (cell.getCellType() != Cell.CELL_TYPE_STRING) continue;

			address = new Address();

			address.setName(addressSheet.getRow(rowIndex).getCell(0, Row.CREATE_NULL_AS_BLANK).getStringCellValue());
			address.setStreetName(addressSheet.getRow(rowIndex).getCell(1, Row.CREATE_NULL_AS_BLANK).getStringCellValue());				
			address.setPostalAndCity(addressSheet.getRow(rowIndex).getCell(2, Row.CREATE_NULL_AS_BLANK).getStringCellValue());

			addressesList.add(address);

			System.out.println(addressSheet.getRow(rowIndex).getCell(1, Row.CREATE_NULL_AS_BLANK).getStringCellValue());
			

		}        
		workbook.close();
		inputStream.close();

	}

	public ArrayList<Address> getAddressesList(){

		return addressesList;

	}

}
<file_sep># LabelFormatter
This little piece of software takes a list of address and converts it to a different format where it can be printed on labels
<file_sep>package nl.timverwaal.labelformatter;

public class Address {
	
	private String Name;
	private String StreetName;
	private String PostalAndCity;
	

	public Address() {		
		
	}


	public String getName() {
		return Name;
	}


	public void setName(String name) {
		Name = name;
	}


	public String getStreetName() {
		return StreetName;
	}


	public void setStreetName(String streetName) {
		StreetName = streetName;
	}


	public String getPostalAndCity() {
		return PostalAndCity;
	}


	public void setPostalAndCity(String postalAndCity) {
		PostalAndCity = postalAndCity;
	}
	
	

}
