I want to read an Excel file and skip blank lines. My code reads data and blank cells. How can I skip blank lines, I am using Apache POI. Help me with this problem
package com.company;
import org.apache.commons.compress.archivers.dump.InvalidFormatException;
import org.apache.poi.EncryptedDocumentException;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.String;
import java.util.Iterator;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
XSSFWorkbook library_table = new XSSFWorkbook(new FileInputStream("C:\\Users\\admin\\Desktop\\Курсовая\\Table for course work.xlsx"));
XSSFSheet library_sheet = library_table.getSheet("Library");
Iterator rowiter = ((XSSFSheet) library_sheet).rowIterator();
boolean continue_first_row = true;
System.out.println("1 - Name\n2 - Author\n3 - Date of publishing");
System.out.print("Choose type of search: ");
int choice = in.nextInt(), count = 0;
while(rowiter.hasNext()){
XSSFRow row = (XSSFRow) rowiter.next();
if (count == 0){
count++;
continue;
}
else {
System.out.println(row.getCell(choice));
}
}
}
}