1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
.\" This file documents the GNU text utilities.
.\"
.\" Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of
.\" this manual under the conditions for verbatim copying, provided that
.\" the entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Permission is granted to copy and distribute translations of this
.\" manual into another language, under the above conditions for modified
.\" versions, except that this permission notice may be stated in a
.\" translation approved by the Foundation.
.\"
.\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved.
.\" Translated Mon Jul 9 1997 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.TH JOIN 1 "GNU Text Utilities" "FSF" \" -*- nroff -*-
.SH 名前
join \- 二つのファイルを読み、フィールドが共通な行を結合する
.SH 書式
.B join
[\-a 1|2] [\-v 1|2] [\-e empty-string] [\-o field-list...] [\-t char]
[\-j[1|2] field] [\-1 field] [\-2 field] file1 file2
.br
.B join
{\-\-help,\-\-version}
.SH 説明
この文書はもうメンテナンスされていないので、不正確・不完全
な可能性がある。現在は texinfo 文書が正式な情報となっている。
.PP
このマニュアルページは GNU 版
.BR join
について記述したものである。
.B join
は
.I file1
の中にある行と
.I file2
の中にある行を調べ、 join フィールドが一致しているペアを標準出力に表示
する。ファイル名のどちらか (両方は駄目) は `\-' のように指定することが
でき、この場合は標準入力が用いられる。
.I file1
と
.I file2
はあらかじめ join フィールドの昇順にソートしておく必要がある (ソートは
数値順ではなく、文字列順に行うこと)。
.I \-t
オプションを指定しない場合は、行の先頭にある空白文字列は無視してソート
しておく。これは
.B sort
に
.I \-b
オプションを指定することによって実行できる。
.PP
デフォルトの動作は以下の通り。 join フィールドはそれぞれの行の先頭フィー
ルドになる。入力においては、フィールドとはひとつ以上の空白 (blank) で
区切られた部分を指し、行先頭の空白文字列は無視される。
出力においては、フィールドはスペースで区切られる。出力のそれぞれの行は
join フィールド、
.IR file1
の残りのフィールド、そして
.IR file2
の残りのフィールドから構成される。
.SS オプション
.TP
.I "\-a file-number"
通常の出力に加え、ファイル
.I file-number
(1 または 2) のうちでペアにならなかった行も出力する。
.TP
.I "\-e string"
空の出力フィールド (入力にフィールドがなかった場合) を
.IR string
で置き換える。
.TP
.I "\-1, \-j1 field"
ファイル 1 のフィールド
.I field
(正の整数) に基づいて join 動作を行う。
.TP
.I "\-2, \-j2 field"
ファイル 2 のフィールド
.I field
(正の整数) に基づいて join 動作を行う。
.TP
.I "\-j field"
.IR "\-1 field \-2 field" .
と同じ。
.TP
.I "\-o field-list..."
それぞれの出力行を
.IR field-list
のフォーマットに基づいて構成する。
.I field-list
中の要素は、ファイル番号 (1 または 2)、ピリオド、フィールド番号 (正の
整数) からなる。フォーマット中のそれぞれの要素はコンマか空白で区切る。
ひとつの
.I \-o
オプションの後に複数の
.I field-list
を指定することもできる。
.I \-o
とともに与えられたすべての
.I field-list
は結合されて出力される。
.TP
.I "\-t char"
入力および出力のフィールド区切りとして
.I char
を用いる。
.TP
.I "\-v file-number"
通常の出力の代わりに、ファイル
.I file-number
(1 または 2) のペアにならなかった行を表示する。
.PP
さらに GNU 版
.B join
がひとつの引き数のみで実行された場合には、以下のオプションが認識される。
.TP
.I "\-\-help"
使い方に関するメッセージを標準出力に表示し、実行成功を返して終了する。
.TP
.I "\-\-version"
バージョン情報を標準出力に表示して終了する。
|