<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Claus Guttesen</title>
    <description>The latest articles on DEV Community by Claus Guttesen (@kometen).</description>
    <link>https://dev.to/kometen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F270126%2F28cd342e-4ae1-42cf-9f90-c8c1a4786fe8.jpeg</url>
      <title>DEV Community: Claus Guttesen</title>
      <link>https://dev.to/kometen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kometen"/>
    <language>en</language>
    <item>
      <title>Check if value is present in all CSV-files </title>
      <dc:creator>Claus Guttesen</dc:creator>
      <pubDate>Mon, 06 Apr 2020 20:43:43 +0000</pubDate>
      <link>https://dev.to/kometen/check-if-value-is-present-in-all-csv-files-3hc2</link>
      <guid>https://dev.to/kometen/check-if-value-is-present-in-all-csv-files-3hc2</guid>
      <description>&lt;p&gt;Hi. I often import CSV-files at work. Sometimes I need to know whether a value is present in a column in all files. Since I don't do that so often I usually just use the cut- and sort-command line utilities into temporary files. But it's boring. So I wrote a small utility called &lt;code&gt;compare&lt;/code&gt; in Rust that can read one or more text-files, specify a column and delimiter and either see if a value is present in all files, or only in one.&lt;/p&gt;

&lt;p&gt;Example using semicolon (;) as delimiter and column two (2) and in all set (i).&lt;/p&gt;

&lt;p&gt;$ cat a.csv&lt;br&gt;
1;a;one&lt;br&gt;
2;b;two&lt;br&gt;
3;c;three&lt;br&gt;
4;d;four&lt;/p&gt;

&lt;p&gt;$ cat b.csv&lt;br&gt;
3;c;three&lt;br&gt;
4;d;four&lt;br&gt;
5;e;five&lt;br&gt;
6;f;six&lt;/p&gt;

&lt;p&gt;$ compare -f a.csv -f b.csv -d ';' -c 2 -o i&lt;br&gt;
four&lt;br&gt;
three&lt;/p&gt;

&lt;p&gt;Can also be used to see what values that are present in only one set (s).&lt;/p&gt;

&lt;p&gt;$ compare -f a.csv -f b.csv -d ';' -c 2 -o s&lt;/p&gt;

&lt;p&gt;one&lt;br&gt;
two&lt;br&gt;
five&lt;br&gt;
six&lt;/p&gt;

&lt;p&gt;Source can be downloaded at &lt;a href="https://github.com/kometen/compare"&gt;https://github.com/kometen/compare&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Regards&lt;br&gt;
Claus&lt;/p&gt;

</description>
      <category>rust</category>
    </item>
  </channel>
</rss>
