[ic] uploading record deletions

Jonathan Clark interchange-users@icdevgroup.org
Sat Oct 19 04:38:00 2002


> > My test file to upload for these last two tests was:
> >
> > sku description
> > 	DELETE	os28057c
> >
> > Which uploads and indicates the item is deleted, but it's still
> there. I did
> > make sure the delete items is checked, if its not it
> autonumbers and creates
> > a new record.
> >
> > I also tried multiple lines (os28057a, os28057b, os28057c) with
> 4.8.5, but
> > got same results. I am able to delete items manually through the UI.
> >
> > I must be missing something, I just can't see what..?
>
> I don't know what it is. Have you unchecked "autonumber if no key"?
> What about database type?
>
> I cannot duplicate here, it deletes fine. As it does on ic1 demo
> at demo.icdevgroup.org....

My tests were on both dbm and MySQL.

Have found the problem.. the clue was in the results:

Using fields from file: 'sku description'
Deleting record 'os28057c
'.
Deleting record 'os28057b
'.
Deleting record 'os28057a
'.

..note the new line after the sku.

I am uploading from a windows platform. If I upload the file with unix line
endings it works fine.

I guess its this section in import_fields.coretag, around line 214:

	while(<UPDATE>) {
		chomp;
		$totcount++;
		($k, @f) = split /$delimiter/o, $_;

In the case of a windows file upload, this probably means that with a
regular upload/import, the last field gets an extra character on the end.

The workaround for now is to add an additional tab character after the sku
on the DELETE line, this won't work for an addition/update line though.

Jonathan
Webmaint.