Open labatt opened 5 years ago
Definitely looks like an issue. I'll look into this as soon as I can.
For the time being, a work around would be to modify the XML to always include the DriveType
but leave it blank if there is not content, if possible.
Thanks - unfortunately I have no control over the source file. It is sent to me from a manufacturer, and "DriveType" is just one of several tags that may or may not be blank unfortunately.
I can, for the moment, work around like this:
$DriveType = $dataRow->getDataItemByFieldName('DriveType');
if ($DriveType->value=='') {$actual=' ';} else {$actual=$DriveType->value;$dataRow->removeDataItem($DriveType);}
$dataRow->addDataItem(new DataItem('DriveType',$actual));
But obviously it's preferable to have it auto-recognize null fields and account for them. Nice tool though!
I might be doing something completely wrong...
If the XML doesn't have DriveType defined for some of the "rows", the CSV file should still have the same number of columns with one blank. Instead, it's just missing the column.
For example, input:
You'll notice the first item has a DriveType but the second one doesn't. Here's the resulting CSV:
The second line should actually be: