[librecat-dev] Vacuum fix on keys?

Nicolas Franck Nicolas.Franck at UGent.be
Wed Sep 13 15:18:07 CEST 2023


@Tobias: if only that were true. Maybe it has two, or three spaces?

Another solution would be to copy the input record to another and
specify all of the valid keys by name, and then run vacuum on that copy.
This way the weird keys are gone.

> On 13 Sep 2023, at 15:02, Tobias Bülte <tobias.buelte at hbz-nrw.de> wrote:
>
> Wouldn't remove_field("") do the trick?
>
>
> Am 13.09.23 um 14:34 schrieb Peil, Vitali:
>> Hi all,
>>
>> I came across some bad data ;-). Tried to fix this with the vacuum fix. The data I have includes empty field names which I want to clean.
>>
>> with the vacuum fix:
>> $ echo '[{"ok": 1, "empty": "", "":"some bad data"}]' | catmandu convert to JSON --fix "vacuum()"
>> Output: [{"":"some bad data","ok":1}]
>>
>> but I would expect as output
>> [{"ok":1}]
>>
>> Is this a bug in the vacuum fix? Is there another way doing this?
>>
>> Best,
>> Vitali
>>
>>
>> _______________________________________________
>> librecat-dev mailing list
>> - send list mails to librecat-dev at lists.uni-bielefeld.de
>> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
>> - project website: http://librecat.org/
> _______________________________________________
> librecat-dev mailing list
> - send list mails to librecat-dev at lists.uni-bielefeld.de
> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
> - project website: http://librecat.org/




More information about the librecat-dev mailing list