<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-BE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;mso-fareast-language:EN-US">You can do it with a visitor<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">do visitor()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">   if all_match(key,'^$')<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">      set_field(key,"DELETE")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">   end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">remove_field(DELETE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;mso-fareast-language:EN-US">The vacuum is not bugged..but it removes only fields with empty values<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">librecat-dev-bounces@lists.uni-bielefeld.de <librecat-dev-bounces@lists.uni-bielefeld.de> on behalf of Tobias Bülte <tobias.buelte@hbz-nrw.de><br>
<b>Date: </b>Wednesday, 13 September 2023 at 15:05<br>
<b>To: </b>librecat-dev@lists.uni-bielefeld.de <librecat-dev@lists.uni-bielefeld.de><br>
<b>Subject: </b>Re: [librecat-dev] Vacuum fix on keys?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Wouldn't remove_field("") do the trick?<br>
<br>
<br>
Am 13.09.23 um 14:34 schrieb Peil, Vitali:<br>
> Hi all,<br>
><br>
> 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.<br>
><br>
> with the vacuum fix:<br>
> $ echo '[{"ok": 1, "empty": "", "":"some bad data"}]' | catmandu convert to JSON --fix "vacuum()"<br>
> Output: [{"":"some bad data","ok":1}]<br>
><br>
> but I would expect as output<br>
> [{"ok":1}]<br>
><br>
> Is this a bug in the vacuum fix? Is there another way doing this?<br>
><br>
> Best,<br>
> Vitali<br>
><br>
><br>
> _______________________________________________<br>
> librecat-dev mailing list<br>
> - send list mails to librecat-dev@lists.uni-bielefeld.de<br>
> - to unsubscribe or change options, visit <a href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.uni-bielefeld.de%2Fmailman2%2Fcgi%2Funibi%2Flistinfo%2Flibrecat-dev&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7C3d4796ae89a2439c332f08dbb459fb1e%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302071354622232%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=YGaPazELNm4TOp7iyjdLrwGoo0i%2FRfPrsixKp6t20FY%3D&reserved=0</a><br>
> - project website: <a href="http://librecat.org/">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibrecat.org%2F&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7C3d4796ae89a2439c332f08dbb459fb1e%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302071354622232%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=%2Fkdc6XDip966Ur1FJOjZRiQ6Ea5T9bmYolD5JW%2BoP2s%3D&reserved=0</a><br>
_______________________________________________<br>
librecat-dev mailing list<br>
- send list mails to librecat-dev@lists.uni-bielefeld.de<br>
- to unsubscribe or change options, visit <a href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.uni-bielefeld.de%2Fmailman2%2Fcgi%2Funibi%2Flistinfo%2Flibrecat-dev&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7C3d4796ae89a2439c332f08dbb459fb1e%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302071354622232%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=YGaPazELNm4TOp7iyjdLrwGoo0i%2FRfPrsixKp6t20FY%3D&reserved=0</a><br>
- project website: <a href="http://librecat.org/">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibrecat.org%2F&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7C3d4796ae89a2439c332f08dbb459fb1e%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302071354622232%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=%2Fkdc6XDip966Ur1FJOjZRiQ6Ea5T9bmYolD5JW%2BoP2s%3D&reserved=0</a><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>