Note that there are some explanatory texts on larger screens.

plurals
  1. POawk paste comparison printing
    primarykey
    data
    text
    <p>I have two files, each file has an md5 checksum of a file name. Both are in separate folders. When I paste these files, I am looking for a mechanism to do the following:</p> <p>if $column 3 matches $column 6, solely print out those two side by side:</p> <pre><code>filename1 = md5_checksum filename2 = md5_checksum filename3 = md5_checksum filename4 = md5_checksum filename5 = md5_checksum filename6 = md5_checksum </code></pre> <p>Hopeful result:</p> <pre><code>filename1 = md5_checksum filename6 = md5_checksum </code></pre> <p>So imagine (or test) the output of:</p> <pre><code>md5 directoryA/* &gt; checkA ; md5 directoryB/* &gt; checkB paste checkA checkB </code></pre> <p>I'd like to say: "Look in checkA, filename1 is also in checkB albeit a different name" (same checksum)</p> <p>FYI, what I have tried:</p> <pre><code>awk &gt; SIMILAR 'NR==FNR{ _[$4]=$4 next}{print $0, _[$4,$4] }' checkA checkB </code></pre> <p>($4 being the field on both files checkA and checkB)</p> <hr> <p>Here is what I perceive is the best explanation as to what I'm trying to do. Sincerest thanks for answering so quickly:</p> <pre><code># touch A/{fee,fie,foo,fum} # touch B/{Bee,Bie,Boo,Bum} # md5 B/* &gt; checkB # md5 A/* &gt; checkA # more checkA MD5 (A/fee) = 2737b49252e2a4c0fe4c342e92b13285 MD5 (A/fie) = df8b712c4fe20a0df933819665770165 MD5 (A/foo) = 51ca4befb7cb5bd22766a33c73ffca5b MD5 (A/fum) = a80b2c31cfc269e4aa2f48658b5349d9 # more checkB # md5 B/* MD5 (B/Bee) = b026324c6904b2a9cb4b88d6d61c81d1 MD5 (B/Bie) = 2737b49252e2a4c0fe4c342e92b13285 MD5 (B/Boo) = df8b712c4fe20a0df933819665770165 MD5 (B/Bum) = 51ca4befb7cb5bd22766a33c73ffca5b </code></pre> <p>If we see here, file foo in A (A/foo) is similar to B/Bum</p> <p>I'd like the output to be something like:</p> <pre><code>A/foo B/Bum = 51ca4befb7cb5bd22766a33c73ffca5b A/fee B/Bie = 2737b49252e2a4c0fe4c342e92b13285 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload