{"id":10208,"date":"2015-02-22T16:01:26","date_gmt":"2015-02-22T07:01:26","guid":{"rendered":"https:\/\/a-tak.com\/blog\/?p=10208"},"modified":"2020-07-13T12:00:14","modified_gmt":"2020-07-13T03:00:14","slug":"taskchute-awk","status":"publish","type":"post","link":"https:\/\/a-tak.com\/blog\/2015\/02\/taskchute-awk\/","title":{"rendered":"\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u304b\u3089\u51fa\u52e4\u3001\u9000\u52e4\u306e\u6642\u9593\u3092\u629c\u304d\u51fa\u3059"},"content":{"rendered":"<div id=\"advads-3784576734\" class=\"advads-before-content-placement advads-entity-placement\" style=\"margin-left: auto;margin-right: auto;text-align: center;\"><div class=\"advads-adlabel\">\u5e83\u544a<\/div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7585646298782746\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:300px;height:250px;\" \ndata-ad-client=\"ca-pub-7585646298782746\" \ndata-ad-slot=\"6112122906\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><div class=\"booklink-box\" style=\"text-align: left; padding-bottom: 20px; font-size: small; \/zoom: 1; overflow: hidden;\">\n<div class=\"booklink-image\" style=\"float: left; margin: 0 15px 10px 0;\"><a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/asin\/4774163562\/website1-22\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" name=\"booklink\"><img data-recalc-dims=\"1\" decoding=\"async\" style=\"border: none;\" src=\"https:\/\/i0.wp.com\/ecx.images-amazon.com\/images\/I\/4158nVCenGL._SL160_.jpg\" alt=\"\" \/><\/a><\/div>\n<div class=\"booklink-info\" style=\"line-height: 120%; \/zoom: 1; overflow: hidden;\">\n<div class=\"booklink-name\" style=\"margin-bottom: 10px; line-height: 120%;\"><a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/asin\/4774163562\/website1-22\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" name=\"booklink\">\u306a\u305c\u3001\u4ed5\u4e8b\u304c\u4e88\u5b9a\u3069\u304a\u308a\u306b\u7d42\u308f\u3089\u306a\u3044\u306e\u304b? ~\u300c\u6642\u9593\u306a\u3044\u75c5\u300d\u306e\u7279\u52b9\u85ac!\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u6642\u9593\u8853<\/a><\/p>\n<div class=\"booklink-powered-date\" style=\"font-size: 8pt; margin-top: 5px; font-family: verdana; line-height: 120%;\">posted with <a href=\"http:\/\/yomereba.com\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\u30e8\u30e1\u30ec\u30d0<\/a><\/div>\n<\/div>\n<div class=\"booklink-detail\" style=\"margin-bottom: 5px;\">\u4f50\u3005\u6728 \u6b63\u609f \u6280\u8853\u8a55\u8ad6\u793e 2014-04-09<\/div>\n<div class=\"booklink-link2\" style=\"margin-top: 10px;\">\n<div class=\"shoplinkamazon\" style=\"display: inline; margin-right: 5px;\"><a title=\"\u30a2\u30de\u30be\u30f3\" href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/asin\/4774163562\/website1-22\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Amazon<\/a><\/div>\n<div class=\"shoplinkkindle\" style=\"display: inline; margin-right: 5px;\"><a href=\"http:\/\/www.amazon.co.jp\/exec\/obidos\/ASIN\/B00JIL942M\/website1-22\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Kindle<\/a><\/div>\n<div class=\"shoplinkrakuten\" style=\"display: inline; margin-right: 5px;\"><a title=\"\u697d\u5929\u30d6\u30c3\u30af\u30b9\" href=\"http:\/\/hb.afl.rakuten.co.jp\/hgc\/031ab7ae.bf2cee6c.0399c94c.aaceb9d6\/?pc=http%3A%2F%2Fbooks.rakuten.co.jp%2Frb%2F12735496%2F%3Fscid%3Daf_ich_link_urltxt%26m%3Dhttp%3A%2F%2Fm.rakuten.co.jp%2Fev%2Fbook%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\u697d\u5929\u30d6\u30c3\u30af\u30b9<\/a><\/div>\n<div class=\"shoplinkkino\" style=\"display: inline; margin-right: 5px;\"><a title=\"kino\" href=\"http:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=2274895&amp;pid=882170520&amp;vc_url=http%3A%2F%2Fwww.kinokuniya.co.jp%2Ff%2Fdsg-01-9784774163567\" target=\"_blank\" rel=\"noopener noreferrer\">\u7d00\u4f0a\u570b\u5c4b\u66f8\u5e97<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ad.jp.ap.valuecommerce.com\/vc\/images\/1x1.gif?resize=1%2C1\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/><\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"booklink-footer\" style=\"clear: left;\"><\/div>\n<\/div>\n<p>\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u30ed\u30b0\u304b\u3089\u51fa\u9000\u52e4\u306e\u6642\u9593\u3092\u629c\u304d\u51fa\u3059Mac\u7528\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u6bce\u6708\u306e\u52e4\u6020\u3092\u51fa\u3059\u306e\u304c\u9762\u5012<\/h2>\n<p>\u6bce\u6708\u3001\u51fa\u52e4\u6642\u9593\u3068\u9000\u52e4\u6642\u9593\u3092\u7533\u544a\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u304c\u9762\u5012\u306a\u306e\u3067\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u30ed\u30b0\u304b\u3089\u51fa\u52e4\u3001\u9000\u52e4\u3092\u629c\u304d\u51fa\u3059\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>\u5fc5\u8981\u74b0\u5883<\/h2>\n<ul>\n<li>awk\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u74b0\u5883(Mac\u3060\u3068\u6700\u521d\u304b\u3089\u5165\u3063\u3066\u3044\u305f\u304b\u3082\u3002\u7121\u3051\u308c\u3070homebrew\u306a\u3069\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044)<\/li>\n<\/ul>\n<h2>\u4ed5\u69d8<\/h2>\n<p>\u793e\u5185\u3067\u4f7f\u3063\u3066\u3044\u308b\u51fa\u9000\u52e4\u306eExcel\u30c4\u30fc\u30eb\u306b\u8aad\u307e\u305b\u308b\u524d\u63d0\u306a\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u306f\u7279\u6b8a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u30ed\u30b0\u304b\u3089\u65e5\u3054\u3068\u306b\u51fa\u52e4\u3001\u9000\u52e4\u306e\u6642\u9593\u3092\u629c\u304d\u51fa\u3059<\/li>\n<li>\u629c\u304d\u51fa\u3057\u305f\u7d50\u679c\u306f\u65e5\u3054\u3068\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b\u3059\u308b(yyyymmdd.txt\u306e\u5f62\u5f0f)<\/li>\n<li>\u51fa\u529b\u5148\u306eyyyymm*\u30d5\u30a1\u30a4\u30eb\u304c\u524a\u9664\u3055\u308c\u308b\u306e\u3067\u3001\u51fa\u529b\u5148\u306f\u5c02\u7528\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u3057\u307e\u3057\u3087\u3046<\/li>\n<\/ul>\n<p>\u65e5\u3054\u3068\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306e\u304c\u3001\u3061\u3087\u3063\u3068\u7279\u6b8a\u3067\u3059\u306d\u3002<\/p>\n<p>\u3042\u3068\u3001\u4e2d\u8eab\u306f\u51fa\u6765\u308c\u3070\u3044\u3044\u3068\u3044\u3046\u611f\u3058\u3067\u4f5c\u3063\u305f\u3082\u306e\u306a\u306e\u3067\u3001\u30b9\u30de\u30fc\u30c8\u3067\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2>\u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n<pre><code>month=201501\r\nrm ${month}*.txt\r\ncd (\u7d50\u679c\u30d5\u30a1\u30a4\u30eb\u3092\u51fa\u529b\u3059\u308b\u30d5\u30a9\u30eb\u30c0)\r\nnkf -w \"(\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a9\u30eb\u30c0)\/\u2605TaskChute_${month}.txt\" | awk -F \" \" '{OFS=\"\\t\";print $3\" \"$6,$12}' | sort | egrep -A2 '\u51fa\u52e4' &gt; work.txt\r\nnkf -w \"(\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a9\u30eb\u30c0)\/\u2605TaskChute_${month}.txt\" | awk -F \" \" '{OFS=\"\\t\";print $3\" \"$5,$12}' | sort | egrep -B2 '\u5e30\u5b85' &gt;&gt; work.txt\r\ncat work.txt | sort  | nkf -s &gt; work2.txt\r\ncat work2.txt | while read line; do filename=`echo ${line} | awk -F \"[\/ ]\" '{print $1$2$3}'`; printf \"%s %s\\t%s\\n\" ${line} &gt;&gt; ${filename}.txt; done\r\n<\/code><\/pre>\n<h2>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u8a2d\u5b9a<\/h2>\n<ul>\n<li>1\u884c\u76ee\u306e\u300cmonth\u300d\u306e\u5f8c\u308d\u3092\u629c\u304d\u51fa\u3057\u5bfe\u8c61\u306e\u5e744\u6841\u3001\u67082\u6841\u306b\u66f8\u304d\u63db\u3048\u307e\u3059<\/li>\n<li>()\u30ab\u30c3\u30b3\u306e\u90e8\u5206\u3092\u81ea\u5206\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u66f8\u304d\u63db\u3048\u307e\u3059\n<ul>\n<li>\u7d50\u679c\u30d5\u30a1\u30a4\u30eb\u3092\u51fa\u529b\u3059\u308b\u30d5\u30a9\u30eb\u30c0<\/li>\n<li>\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a9\u30eb\u30c0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u3001\u8a2d\u5b9a\u3057\u305f\u3089\u30b3\u30d4\u30fc\u3057\u3066\u3001Mac\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u307e\u3068\u3081\u3066\u8cbc\u308a\u4ed8\u3051\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<h2>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u88dc\u8db3\u8aac\u660e<\/h2>\n<ul>\n<li>awk\u306e\u5f8c\u308d\u306e\u300c-A2\u300d\u306f\u51fa\u52e4\u306e\u6587\u5b57\u304c\u3042\u308b\u884c\u3068\u3001\u305d\u306e\u5f8c\u308d\u306e2\u884c\u3082\u6301\u3063\u3066\u304f\u308b\u3068\u3044\u3046\u610f\u5473\u3002\u90aa\u9b54\u306a\u3089\u300c-A2\u300d\u3092\u6d88\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<li>awk\u306e\u5f8c\u308d\u306e\u300c-B2\u300d\u306f\u5e30\u5b85\u306e\u6587\u5b57\u304c\u3042\u308b\u884c\u3068\u3001\u305d\u306e\u524d2\u884c\u3082\u6301\u3063\u3066\u304f\u308b\u3068\u3044\u3046\u610f\u5473\u3002\u90aa\u9b54\u306a\u3089\u6d88\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<li>echo\u3060\u3068\u30bf\u30d6\u306e\u51fa\u529b\u304c\u51fa\u6765\u306a\u304b\u3063\u305f\u306e\u3067printf\u4f7f\u3063\u305f\u3002<\/li>\n<li>\u51fa\u529b\u7d50\u679c\u306f\u65e5\u4ed8\u6642\u523b\u306e\u5f8c\u308d\u306b\u30bf\u30d6\u3092\u3064\u3051\u3066\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u306e\u9805\u76ee\u540d\u3092\u51fa\u529b\u3002<\/li>\n<\/ul>\n<h2>\u4ee5\u4e0a<\/h2>\n<p>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u65e5\u4ed8\u6bce\u306e\u30d5\u30a1\u30a4\u30eb\u4f5c\u308b\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u3082\u591a\u5c11\u306f\u5f79\u306b\u7acb\u3064\u304b\u306a?<\/p><div id=\"advads-209967927\" class=\"advads-content-placement-after-3rd-paragraph advads-entity-placement\" style=\"margin-left: auto;margin-right: auto;text-align: center;\"><div class=\"advads-adlabel\">\u5e83\u544a<\/div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7585646298782746\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:300px;height:250px;\" \ndata-ad-client=\"ca-pub-7585646298782746\" \ndata-ad-slot=\"6112122906\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p>\u304a\u597d\u304d\u306b\u6539\u9020\u3057\u3066\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306a\u305c\u3001\u4ed5\u4e8b\u304c\u4e88\u5b9a\u3069\u304a\u308a\u306b\u7d42\u308f\u3089\u306a\u3044\u306e\u304b? ~\u300c\u6642\u9593\u306a\u3044\u75c5\u300d\u306e\u7279\u52b9\u85ac!\u30bf\u30b9\u30af\u30b7\u30e5\u30fc\u30c8\u6642\u9593\u8853 posted with \u30e8\u30e1\u30ec\u30d0 \u4f50\u3005\u6728 \u6b63\u609f \u6280\u8853\u8a55\u8ad6\u793e 2014-04-09 Amazon Kindle \u697d\u5929\u30d6\u30c3\u30af\u30b9 \u7d00\u4f0a\u570b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[59,22],"tags":[532,525,69,533,361],"class_list":["post-10208","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mac-2","category-work","tag-awk","tag-mac-2","tag-tips","tag-533","tag-361"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/a-tak.com\/blog\/wp-content\/uploads\/2015\/02\/4158nVCenGL._SL160_.jpg?fit=97%2C160&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/posts\/10208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/comments?post=10208"}],"version-history":[{"count":0,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/posts\/10208\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/media\/10209"}],"wp:attachment":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/media?parent=10208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/categories?post=10208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/tags?post=10208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}