<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can you get rid of duplicate values in a csv file using ModelBuilder? in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780054#M1283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also run the script in the model.......&amp;nbsp; I would not recommend it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2019 15:34:15 GMT</pubDate>
    <dc:creator>TedKowal</dc:creator>
    <dc:date>2019-06-13T15:34:15Z</dc:date>
    <item>
      <title>Can you get rid of duplicate values in a csv file using ModelBuilder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780050#M1279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently interning and have created a model.&amp;nbsp; Part of the model will populate a csv file in excel, but when I run it again it does not delete previous values or get rid of duplicates.&amp;nbsp; I would like to know how I can delete duplicate values in the csv file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2019 12:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780050#M1279</guid>
      <dc:creator>deleted-user-TdXMAAbco1KJ</dc:creator>
      <dc:date>2019-06-06T12:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can you get rid of duplicate values in a csv file using ModelBuilder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780051#M1280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This statement "...&lt;SPAN style="background-color: #ffffff;"&gt;populate a csv file in excel" makes no sense, how can you have a CSV in an Excel document? You give zero details of the model, so this question is impossible to answer. If you write your data to a Table, so not Excel or CSV then you could use the Delete Identical tool...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2019 09:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780051#M1280</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2019-06-12T09:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can you get rid of duplicate values in a csv file using ModelBuilder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780052#M1281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will take a pop shot at the question.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would run a python script that removes duplicate lines before you need to use the CVS .... Then your model would not have to worry about duplicate values.&amp;nbsp; In the example below, 1.csv contains duplicate lines; the script create a 2.csv that removes the duplicates.&amp;nbsp; You would use 2.csv in your model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;inFile &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'1.csv'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'r'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

outFile &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2.csv'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'w'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

listLines &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; line &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; inFile&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; line &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; listLines&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;continue&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        outFile&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;write&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;line&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        listLines&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;line&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

outFile&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;close&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

inFile&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;close&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:48:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780052#M1281</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-12T08:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can you get rid of duplicate values in a csv file using ModelBuilder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780053#M1282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One could also wrap such a Python workflow in a function embedded in the Calculate Value tool. Just sayin!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2019 23:20:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780053#M1282</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2019-06-12T23:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can you get rid of duplicate values in a csv file using ModelBuilder?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780054#M1283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also run the script in the model.......&amp;nbsp; I would not recommend it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 15:34:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/can-you-get-rid-of-duplicate-values-in-a-csv-file/m-p/780054#M1283</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2019-06-13T15:34:15Z</dc:date>
    </item>
  </channel>
</rss>

