mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Update notes for 2017-02-28
This commit is contained in:
@ -372,8 +372,18 @@ COPY 1968
|
||||
</code></pre>
|
||||
|
||||
<ul>
|
||||
<li>And then using awk or uniq to either remove or print the lines that have a duplicate <code>resource_id</code> (meaning they belong to the same item in DSpace and are therefore duplicates), and then using the <code>metadata_value_id</code> to delete them</li>
|
||||
</ul></description>
|
||||
<li>And then use awk to print the duplicate lines to a separate file:</li>
|
||||
</ul>
|
||||
|
||||
<pre><code>$ awk -F',' 'seen[$1]++' /tmp/ciat.csv &gt; /tmp/ciat-dupes.csv
|
||||
</code></pre>
|
||||
|
||||
<ul>
|
||||
<li>From that file I can create a list of 279 deletes and put them in a batch script like:</li>
|
||||
</ul>
|
||||
|
||||
<pre><code>delete from metadatavalue where resource_type_id=2 and metadata_field_id=3 and metadata_value_id=2742061;
|
||||
</code></pre></description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
Reference in New Issue
Block a user