Browse Source

Implemented keepEmptyRows (closes #71)

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

9
papaparse.js

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

Loading…
Cancel
Save