Browse Source

Implemented keepEmptyRows (closes #71)

pull/72/merge
Matthew Holt 11 years ago
parent
commit
0fb8537e06
  1. 11
      papaparse.js

11
papaparse.js

@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
worker: false,
comments: false,
complete: undefined,
download: false
download: false,
keepEmptyRows: false
};
global.Papa = {};
@ -1036,7 +1037,10 @@ @@ -1036,7 +1037,10 @@
{
if (_data[_rowIdx].length == 1 && EMPTY.test(_data[_rowIdx][0]))
{
_data.splice(_rowIdx, 1);
if (config.keepEmptyRows)
_data[_rowIdx].splice(0, 1);
else
_data.splice(_rowIdx, 1);
_rowIdx = _data.length - 1;
}
}
@ -1241,6 +1245,9 @@ @@ -1241,6 +1245,9 @@
if (typeof config.download !== 'boolean')
config.download = DEFAULTS.download;
if (typeof config.keepEmptyRows !== 'boolean')
config.keepEmptyRows = DEFAULTS.keepEmptyRows;
return config;
}

Loading…
Cancel
Save