使用法: join [オプション]... ファイル1 ファイル2
For each pair of input lines with identical join fields, write a line to
standard output. The default join field is the first, delimited
by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.
-a FILENUM print unpairable lines coming from file FILENUM, where
FILENUM is 1 or 2, corresponding to FILE1 or FILE2
-e EMPTY replace missing input fields with EMPTY
-i, --ignore-case ignore differences in case when comparing fields
-j FIELD equivalent to `-1 FIELD -2 FIELD'
-o FORMAT obey FORMAT while constructing output line
-t CHAR use CHAR as input and output field separator
-v FILENUM like -a FILENUM, but suppress joined output lines
-1 FIELD join on this FIELD of file 1
-2 FIELD join on this FIELD of file 2
--check-order check that the input is correctly sorted, even
if all input lines are pairable
--nocheck-order do not check that the input is correctly sorted
--help この使い方を表示して終了
--version バージョン情報を表示して終了
Unless -t CHAR is given, leading blanks separate fields and are ignored,
else fields are separated by CHAR. Any FIELD is a field number counted
from 1. FORMAT is one or more comma or blank separated specifications,
each being `FILENUM.FIELD' or `0'. Default FORMAT outputs the join field,
the remaining fields from FILE1, the remaining fields from FILE2, all
separated by CHAR.
Important: FILE1 and FILE2 must be sorted on the join fields.
E.g., use `sort -k 1b,1' if `join' has no options.
Note, comparisons honor the rules specified by `LC_COLLATE'.
If the input is not sorted and some lines cannot be joined, a
warning message will be given.
Report join bugs to bug-coreutils@gnu.org
GNU coreutils home page:
Usage: join [OPTION]... FILE1 FILE2
For each pair of input lines with identical join fields, write a line to
standard output. The default join field is the first, delimited
by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.
-a FILENUM print unpairable lines coming from file FILENUM, where
FILENUM is 1 or 2, corresponding to FILE1 or FILE2
-e EMPTY replace missing input fields with EMPTY
-i, --ignore-case ignore differences in case when comparing fields
-j FIELD equivalent to `-1 FIELD -2 FIELD'
-o FORMAT obey FORMAT while constructing output line
-t CHAR use CHAR as input and output field separator
-v FILENUM like -a FILENUM, but suppress joined output lines
-1 FIELD join on this FIELD of file 1
-2 FIELD join on this FIELD of file 2
--check-order check that the input is correctly sorted, even
if all input lines are pairable
--nocheck-order do not check that the input is correctly sorted
--help display this help and exit
--version output version information and exit
Unless -t CHAR is given, leading blanks separate fields and are ignored,
else fields are separated by CHAR. Any FIELD is a field number counted
from 1. FORMAT is one or more comma or blank separated specifications,
each being `FILENUM.FIELD' or `0'. Default FORMAT outputs the join field,
the remaining fields from FILE1, the remaining fields from FILE2, all
separated by CHAR.
Important: FILE1 and FILE2 must be sorted on the join fields.
E.g., use `sort -k 1b,1' if `join' has no options.
Note, comparisons honor the rules specified by `LC_COLLATE'.
If the input is not sorted and some lines cannot be joined, a
warning message will be given.
Report join bugs to bug-coreutils@gnu.org
GNU coreutils home page:
JOIN(1) JOIN(1)
名前
join - 二つのファイルを読み、フィールドが共通な行を結合する
書式
join [-i] [-1 FIELD] [-2 FIELD] [-a FILE-NUMBER] [-e STRING] [-j FIELD]
[-j1 FIELD] [-j2 FIELD] [-o FIELD-LIST] [-t CHAR] [-v FILE-NUMBER]
[--ignore-case] FILE1 [FILE2]
join [--help] [--version]
説明
join は join フィールドが一致している入力行の各ペアを標準出力に表示する
。一方の FILE が与えられないと標準入力から読み込む。また FILE が ‘-’ だ
った場合には、そのファイルには標準入力が用いられる。
FILE1 と FILE2 は実行前に join フィールドの昇順にソートしておかなければ
ならない (数値順のソートはだめ)。 -t オプションが与えられなかった場合は
、 ファイルは join フィールドの先頭にある空白を無視してソートしておかな
ければならない (‘sort -b’ のようなかたち)。 --ignore-case オプション を
与 える場合には、各行は join フィールドの英大文字小文字を無視してソート
しておかなければならない (‘sort -f’ のようなかたち)。
デフォルトの動作は以下の通り: join フィールドは各行の先頭に来る。入力は
1 つ以上の空白でフィールドに分割され、行頭の空白は無視される。出力のフ
ィールドは 1 つのスペースで区切られる。出力行は、 join フィ ー ル ド 、
FILE1 の残りのフィールド、 FILE2 の残りのフィールドからなる。
オプション
-1 FIELD, -j1 FIELD
FILE1 の FIELD 番目のフィールドを用いて join を行う (FIELD は正
の整数)。
-2 FIELD, -j2 FIELD
FILE2 の FIELD 番目のフィールドを用いて join を行う (FIELD は 正
の整数)。
-a FILE-LIST
FILE-NUMBER (‘1’ または ‘2’) のファイルにあるペアにならなかった
行を、通常の出力に追加して表示する。
-e STRING
入力にフィールドがなかった場合、それに対応する出力フィール ド を
STRING にする。
-i, --ignore-case
キーを比較するときに英大文字小文字の違いを無視する。このオプショ
ンを指定するときは、入力ファイルも同じように整列させておかなけれ
ばならない。このような整列を行うには ‘sort -f’ を使えば良い。
-j FIELD
-1 FIELD -2 FIELD と同じ。
-o FIELD-LIST...
出力行のフォーマットに FIELD-LIST を用いる。 FIELD-LIST の各要素
は、一文字 ‘0’ または M.N の形式である。ここで M はファイル番 号
で ‘1’ または ‘2’ である。 N は正の整数で、フィールドの番号であ
る。
フィールド指定 ‘0’ は join フィールドを表す。ほとんどの場合は 、
‘0’ の機能は M.N を用いて join フィールドを明示的に指定するやり
方でも再現可能であろう。しかし、 (-a や -v オプションを使った と
きに) ペアにならなかった行も表示する場合は、両方のファイルにその
ような行があると、 FIELD-LIST で M.N を使うやり方では join フ ィ
ー ル ドを指定することはできない。 join にこの機能を与えるため、
POSIX で ‘0’ フィールド指定の記述が発明された。
FIELD-LIST の各要素はコンマまたは空白で区切られる。一つの -o オ
プ ションの後に複数の FIELD-LIST 引数を指定することも出来る。 -o
オプション以降の全てのリストの値は結合される。 FIELD-LIST の指定
は 、 (-a や -v オプションに由来するものも含め) 全ての出力行に適
用される。
-t CHAR
入力・出力のフィールド区切りに文字 CHAR を用いる。
-v FILE-NUMBER
通常の出力ではなく、 FILE-NUMBER (‘1’ または ‘2’) のファイルにあ
る、ペアにならなかった行だけを表示する。
--help 標準出力に使用方法のメッセージを出力して正常終了する。
--version
標準出力にバージョン情報を出力して正常終了する。
注意
プログラムのバグについては bug-textutils@gnu.org に報告してください。
man ページは Ragnar Hojland Espinosa
JOIN(1) User Commands JOIN(1)
NAME
join - join lines of two files on a common field
SYNOPSIS
join [OPTION]... FILE1 FILE2
DESCRIPTION
For each pair of input lines with identical join fields, write a line
to standard output. The default join field is the first, delimited by
whitespace. When FILE1 or FILE2 (not both) is -, read standard input.
-a FILENUM
print unpairable lines coming from file FILENUM, where FILENUM
is 1 or 2, corresponding to FILE1 or FILE2
-e EMPTY
replace missing input fields with EMPTY
-i, --ignore-case
ignore differences in case when comparing fields
-j FIELD
equivalent to ‘-1 FIELD -2 FIELD’
-o FORMAT
obey FORMAT while constructing output line
-t CHAR
use CHAR as input and output field separator
-v FILENUM
like -a FILENUM, but suppress joined output lines
-1 FIELD
join on this FIELD of file 1
-2 FIELD
join on this FIELD of file 2
--check-order
check that the input is correctly sorted, even if all input
lines are pairable
--nocheck-order
do not check that the input is correctly sorted
--help display this help and exit
--version
output version information and exit
Unless -t CHAR is given, leading blanks separate fields and are
ignored, else fields are separated by CHAR. Any FIELD is a field num-
ber counted from 1. FORMAT is one or more comma or blank separated
specifications, each being ‘FILENUM.FIELD’ or ‘0’. Default FORMAT out-
puts the join field, the remaining fields from FILE1, the remaining
fields from FILE2, all separated by CHAR.
Important: FILE1 and FILE2 must be sorted on the join fields. E.g.,
use ‘sort -k 1b,1’ if ‘join’ has no options. Note, comparisons honor
the rules specified by ‘LC_COLLATE’. If the input is not sorted and
some lines cannot be joined, a warning message will be given.
AUTHOR
Written by Mike Haertel.
REPORTING BUGS
Report join bugs to bug-coreutils@gnu.org
GNU coreutils home page:
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa