Excel file without headers, skipping first line
See original GitHub issueWe are trying to use the library on an excel without headers(We set a template for download to show the way its meant to be used, but apparently thats not what they have in mind), but we saw in the code, that no matter what, the first row is always ignored because of the hardcoded + 1
, there´s no way we can set skip
or headerStart
as negative cause an exception is thrown. Is there an option we hadn’t see to read an excel without headers?
public static PoijiOptionsBuilder settings(int skip) {
if (skip < 0) {
throw new PoijiException("Skip index must be greater than or equal to 0");
}
return new PoijiOptionsBuilder(skip);
}
public PoijiOptionsBuilder headerStart(int headerStart) {
if (headerStart < 0) {
throw new PoijiException("Header index must be greater than or equal to 0");
}
this.headerStart = headerStart;
return this;
}
public PoijiOptions build() {
return new PoijiOptions()
.setSkip(skip + headerStart + 1)
.setPassword(password)
.setPreferNullOverDefault(preferNullOverDefault)
.setDatePattern(datePattern)
.setDateFormatter(dateFormatter)
.setDateTimeFormatter(dateTimeFormatter)
.setSheetIndex(sheetIndex)
.setSheetName(sheetName)
.setIgnoreHiddenSheets(ignoreHiddenSheets)
.setTrimCellValue(trimCellValue)
.setDateRegex(dateRegex)
.setDateTimeRegex(dateTimeRegex)
.setDateLenient(dateLenient)
.setHeaderStart(headerStart)
.setCasting(casting)
.setLimit(limit)
.setPoijiLogCellFormat(cellFormat)
.setPoijiNumberFormat(numberFormat)
.setCaseInsensitive(caseInsensitive)
.setNamedHeaderMandatory(namedHeaderMandatory);
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Turn Excel table headers on or off - Microsoft Support
When you create an Excel table, a table Header Row is automatically added as the first row of the table, but you have...
Read more >How to read a excel file without taking its first row as header ...
First answer on google when you search for "pandas read excel file skip header": Pandas doc for method read_excel which has a skiprows ......
Read more >How to get excel row numbers to skip the header - Super User
This formula keeps the row numbers accurate when sorting, and does not count the first row for the headings. (1) You don't need...
Read more >Skip first rows excel and read headers - Alteryx Community
That option is only available in xlsx and not xls. You can use the "first row contains data" to push your headers into...
Read more >[Solved] Streamwriter skipping my first row of data - CodeProject
I my work with connecting to Excel using C#, I've not seen it skip two lines. My guess is that you don't have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fix is ready with 3.0.0
Hi @ozlerhakan, wasn’t able to respond. That’s great news, thanks for the immediate response, looking forward to it.