Have a look at Apache POI to read the content of an Excel file. The rest should be easy.