#author("2018-07-26T00:36:01+09:00","default:Miyashita","Miyashita")
#author("2021-04-07T18:29:29+09:00","default:Miyashita","Miyashita")
*paste コマンド メモ [#j4c1aee2]
ファイルAのn列目とファイルBのm列目を一つのファイルにしたい…という時に.~
awkとよく一緒に使う.例えば,
ファイルA の n 列目とファイルB の m 列目を一つのファイルにしたい…という時に.~
awk とよく一緒に使う.例えば,
#codeprettify(lang-bash){{
awk -F',' '{printf "%8.3f,%8.3f\n",$1,$2}' fileA.dat> tmp1.dat
awk -F',' '{printf "%8.3f\n",$1}' fileB.dat> tmp2.dat
paste tmp*.dat -d"," > out.dat
rm tmp*.dat
}}
fileA.datの1,2列目,fileB.datの1列目で3列をなす新しいファイルout.datができる.~
また,pasteのオプション-dで区切り文字を設定できる.デフォルトは空白.上記はカンマ区切り.
fileA.dat の 1,2 列目,fileB.dat の 1 列目で 3 列をなす新しいファイル out.dat ができる.~
また,paste のオプション -d で区切り文字を設定できる.デフォルトは空白.上記はカンマ区切り.

Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes