0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

csvkitでvlookupのような表結合を行う

Posted at

cost.csv
TYPE,COST
A,100
B,200
C,300

model.csv
MODEL,TYPE
m1,A
m2,C
m3,B
m4,C
m5,A

csvjoin -c TYPE --left model.csv cost.csv

MODEL,TYPE,COST
m1,A,100
m2,C,300
m3,B,200
m4,C,300
m5,A,100

csvstatを使うとcostの合計も計算できる。

csvjoin -c TYPE --left model.csv cost.csv | csvstat -c COST --sum

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?