{"id":570,"date":"2014-11-04T23:42:15","date_gmt":"2014-11-05T04:42:15","guid":{"rendered":"http:\/\/devolve.net\/blog\/?p=570"},"modified":"2018-07-13T10:17:08","modified_gmt":"2018-07-13T14:17:08","slug":"get-items-unique-only-to-list1","status":"publish","type":"post","link":"https:\/\/www.devolve.local\/get-items-unique-only-to-list1\/","title":{"rendered":"Get items unique only to list1"},"content":{"rendered":"

…from two lists with some overlap. Spent some time working in Python on this problem. Afterwards, I realized it’s a shell one-liner.<\/p>\n

comm -23 <(sort f_most) <(sort f_some) | sort -n > f_uniq_to_1<\/code><\/p>\n

I re-sort the output numerically since comm<\/code> assumes its input is sorted lexicographically, and I happen to be comparing lists of numbers.<\/p>\n","protected":false},"excerpt":{"rendered":"

…from two lists with some overlap. Spent some time working in Python on this problem. Afterwards, I realized it’s a shell one-liner. comm -23 <(sort f_most) <(sort f_some) | sort -n > f_uniq_to_1 I re-sort the output numerically since comm assumes its input is sorted lexicographically, and I happen to be comparing lists of numbers.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[34,41],"_links":{"self":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/570"}],"collection":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/comments?post=570"}],"version-history":[{"count":6,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":577,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/570\/revisions\/577"}],"wp:attachment":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/media?parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/categories?post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/tags?post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}