parse skip for CSV

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@524299 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-03-30 22:30:17 +00:00
parent 731416af36
commit f519838b7f
1 changed files with 3 additions and 1 deletions

View File

@ -229,6 +229,8 @@ abstract class CSVLoader {
Boolean hasHeader = params.getBool(HEADER);
skipLines = params.getInt(SKIP,0);
if (fieldnames==null) {
if (null == hasHeader) {
// assume the file has the headers if they aren't supplied in the args
@ -239,7 +241,7 @@ abstract class CSVLoader {
} else {
// if the fieldnames were supplied and the file has a header, we need to
// skip over that header.
if (hasHeader!=null && hasHeader) skipLines=1;
if (hasHeader!=null && hasHeader) skipLines++;
prepareFields();
}