<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>morihaya</author_name>
  <author_url>https://blog.hatena.ne.jp/morihaya/</author_url>
  <blog_title>もりはやメモφ(・ω・ )</blog_title>
  <blog_url>https://blog.morihaya.tech/</blog_url>
  <categories>
    <anon>小ネタ</anon>
    <anon>ShellScript</anon>
  </categories>
  <description>ぱっとやりたかったので調べたところ、予想以上に簡単でした。シェル芸便利です。 やりたかったこと 以下のようなCSVファイルがあり、各キー(a,b,c,d)の合計を計算したいです。（実際のファイルはもっと大容量です） a,1 b,2 c,3 a,4 b,5 c,6 d,7 どうやったか awkコマンドでは以下が可能でした。 連想配列 連想配列に入った値を for( i in arr) で簡単にループできる $ cat hoge.csv | awk -F, '{arr[$1] = arr[$1] + $2}END{for(i in arr){print i , arr[i]} }' こうなった 結…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.morihaya.tech%2Fentry%2F2022%2F11%2F30%2F223759&quot; title=&quot;awkの連想配列で同じキーが複数回出現するデータを集計する - もりはやメモφ(・ω・ )&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-11-30 22:37:59</published>
  <title>awkの連想配列で同じキーが複数回出現するデータを集計する</title>
  <type>rich</type>
  <url>https://blog.morihaya.tech/entry/2022/11/30/223759</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
