csv plugin: be more aggressive about detecting and ignoring blank lines
This commit is contained in:
parent
2bed3d1acf
commit
cf3bbb8cf0
1 changed files with 3 additions and 6 deletions
|
@ -428,19 +428,16 @@ void csv_datasource::parse_csv(T& stream,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned line_length = csv_line.length();
|
|
||||||
|
|
||||||
// skip blank lines
|
// skip blank lines
|
||||||
if (line_length < 5)
|
unsigned line_length = csv_line.length();
|
||||||
|
if (line_length <= 10)
|
||||||
{
|
{
|
||||||
std::string trimmed = csv_line;
|
std::string trimmed = csv_line;
|
||||||
boost::trim_if(trimmed,boost::algorithm::is_any_of("\",'\r\n "));
|
boost::trim_if(trimmed,boost::algorithm::is_any_of("\",'\r\n "));
|
||||||
if (trimmed.empty())
|
if (trimmed.empty())
|
||||||
{
|
{
|
||||||
++line_number;
|
++line_number;
|
||||||
|
|
||||||
MAPNIK_LOG_DEBUG(csv) << "csv_datasource: empty row encountered at line: " << line_number;
|
MAPNIK_LOG_DEBUG(csv) << "csv_datasource: empty row encountered at line: " << line_number;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue