1 .\" You may copy, distribute and modify under the terms of the LDP General
2 .\" Public License as specified in the LICENSE file that comes with the
3 .\" gnumaniak distribution
5 .\" The author kindly requests that no comments regarding the "better"
6 .\" suitability or up-to-date notices of any info documentation alternative
7 .\" is added without contacting him first.
9 .\" (C) 2002 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
12 .\" man pages are NOT obsolete!
13 .\" <ragnar@ragnar-hojland.com>
15 .\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved.
16 .\" Translated Sun 12 Mar 2000 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
18 .TH JOIN 1 "7 October 2002" "GNU textutils 2.1"
20 .\"O \fBjoin\fR \- join lines on a common field
22 join \- Æó¤Ä¤Î¥Õ¥¡¥¤¥ë¤òÆɤߡ¢¥Õ¥£¡¼¥ë¥É¤¬¶¦Ä̤ʹԤò·ë¹ç¤¹¤ë
29 [\fB\-a \fIFILE\-NUMBER\fR]
34 [\fB\-o \fIFIELD\-LIST\fR]
36 [\fB\-v \fIFILE-NUMBER\fR]
37 .RB [ \-\-ignore\-case ]
38 .IR FILE1 " [" FILE2 ]
40 .BR join " [" \-\-help "] [" \-\-version ]
44 .\"O writes to standard output a line for each pair of input lines that have
45 .\"O identical join field.
48 .\"O is missing or if it is a
50 .\"O standard input is used as input for that file.
52 ¤Ï join ¥Õ¥£¡¼¥ë¥É¤¬°ìÃפ·¤Æ¤¤¤ëÆþÎϹԤγƥڥ¢¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£
55 ¤¬Í¿¤¨¤é¤ì¤Ê¤¤¤Èɸ½àÆþÎϤ«¤éÆɤ߹þ¤à¡£¤Þ¤¿
59 ¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ïɸ½àÆþÎϤ¬ÍѤ¤¤é¤ì¤ë¡£
61 .\"O \fIFILE1\fR and \fIFILE2\fR should be already sorted in increasing order
62 .\"O (not numerically) on the join fields; unless the \fB\-t\fR option is given,
63 .\"O they should be sorted ignoring blanks at the start of the join field,
64 .\"O as in `sort \-b'. If the \fB\-\-ignore\-case\fR option is given, lines should
65 .\"O be sorted without regard to the case of characters in the join field,
66 .\"O as in `sort \-f'.
67 .IR FILE1 " ¤È " FILE2
68 ¤Ï¼Â¹ÔÁ°¤Ë join ¥Õ¥£¡¼¥ë¥É¤Î¾º½ç¤Ë¥½¡¼¥È¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤
69 (¿ôÃͽç¤Î¥½¡¼¥È¤Ï¤À¤á)¡£
71 ¥ª¥×¥·¥ç¥ó¤¬Í¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ï join ¥Õ¥£¡¼¥ë¥É¤Î
72 ÀèƬ¤Ë¤¢¤ë¶õÇò¤ò̵»ë¤·¤Æ¥½¡¼¥È¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤
73 (`sort \-b' ¤Î¤è¤¦¤Ê¤«¤¿¤Á)¡£
75 ¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢³Æ¹Ô¤Ï
76 join ¥Õ¥£¡¼¥ë¥É¤Î±ÑÂçʸ»ú¾®Ê¸»ú¤ò̵»ë¤·¤Æ¥½¡¼¥È¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤
77 (`sort \-f' ¤Î¤è¤¦¤Ê¤«¤¿¤Á)¡£
79 .\"O The defaults are: the join field is the first field in each line;
80 .\"O fields in the input are separated by one or more blanks, with leading
81 .\"O blanks on the line ignored; fields in the output are separated by a
82 .\"O space; each output line consists of the join field, the remaining
83 .\"O fields from \fIFILE1\fR, then the remaining fields from \fIFILE2\fR.
84 ¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï°Ê²¼¤ÎÄ̤ê:
85 join ¥Õ¥£¡¼¥ë¥É¤Ï³Æ¹Ô¤ÎÀèƬ¤ËÍè¤ë¡£
86 ÆþÎÏ¤Ï 1 ¤Ä°Ê¾å¤Î¶õÇò¤Ç¥Õ¥£¡¼¥ë¥É¤Ëʬ³ä¤µ¤ì¡¢
87 ¹ÔƬ¤Î¶õÇò¤Ï̵»ë¤µ¤ì¤ë¡£½ÐÎϤΥե£¡¼¥ë¥É¤Ï 1 ¤Ä¤Î¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤é¤ì¤ë¡£
88 ½ÐÎϹԤϡ¢ join ¥Õ¥£¡¼¥ë¥É¡¢
92 ¤Î»Ä¤ê¤Î¥Õ¥£¡¼¥ë¥É¤«¤é¤Ê¤ë¡£
96 .B \-1 \fIFIELD\fB, \-j1 \fIFIELD
97 .\"O Join on field \fIFIELD\fR (a positive integer) of \fIFILE1\fR.
101 ÈÖÌܤΥե£¡¼¥ë¥É¤òÍѤ¤¤Æ join ¤ò¹Ô¤¦
105 .B \-2 \fIFIELD\fB, \-j2 \fIFIELD
106 .\"O Join on field \fIFIELD\fR (a positive integer) of \fIFILE2\fR.
110 ÈÖÌܤΥե£¡¼¥ë¥É¤òÍѤ¤¤Æ join ¤ò¹Ô¤¦
114 .B \-a \fIFILE\-LIST\fB
115 .\"O Print a line for each unpairable line in file \fIFILE\-NUMBER\fR (either
116 .\"O .RB ` 1 "' or `" 2 '),
117 .\"O in addition to the normal output.
119 .RB (` 1 "' ¤Þ¤¿¤Ï `" 2 ')
120 ¤Î¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¥Ú¥¢¤Ë¤Ê¤é¤Ê¤«¤Ã¤¿¹Ô¤ò¡¢Ä̾ï¤Î½ÐÎϤËÄɲä·¤Æɽ¼¨¤¹¤ë¡£
123 .\"O Replace those output fields that are missing in the input with \fISTRING\fR.
124 ÆþÎϤ˥ե£¡¼¥ë¥É¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¤½¤ì¤ËÂбþ¤¹¤ë½ÐÎÏ¥Õ¥£¡¼¥ë¥É¤ò
127 .\"nakano: ¤Á¤ç¤Ã¤ÈÆ°ºî¤¬¤è¤¯¤ï¤«¤é¤ó...
129 .B \-i, \-\-ignore\-case
130 .\"O Ignore differences in case when comparing keys. With this option,
131 .\"O the lines of the input files must be ordered in the same way. Use
132 .\"O `sort \-f' to produce this ordering.
133 ¥¡¼¤òÈæ³Ó¤¹¤ë¤È¤¤Ë±ÑÂçʸ»ú¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤¹¤ë¡£
134 ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¤¤Ï¡¢
135 ÆþÎÏ¥Õ¥¡¥¤¥ë¤âƱ¤¸¤è¤¦¤ËÀ°Î󤵤»¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
136 ¤³¤Î¤è¤¦¤ÊÀ°Îó¤ò¹Ô¤¦¤Ë¤Ï `sort \-f' ¤ò»È¤¨¤ÐÎɤ¤¡£
139 .\"O Equivalent to \fB\-1 \fIFIELD \fB\-2 \fIFIELD\fR.
146 .B \-o \fIFIELD\-LIST...
147 .\"O Construct each output line according to the format in \fIFIELD\-LIST\fR.
148 .\"O Each element in \fIFIELD\-LIST\fR is either the single character `\fB0\fR' or
149 .\"O has the form \fIM\fB.\fIN\fR where the file number, \fIM\fR, is
150 .\"O .RB ` 1 "' or `" 2 '
151 .\"O and \fIN\fR is a positive field number.
152 ½ÐÎϹԤΥե©¡¼¥Þ¥Ã¥È¤Ë
156 ¤Î³ÆÍ×ÁǤϡ¢°ìʸ»ú `\fB0\fP' ¤Þ¤¿¤Ï \fIM\fB.\fIN\fR ¤Î·Á¼°¤Ç¤¢¤ë¡£
157 ¤³¤³¤Ç \fIM\fP ¤Ï¥Õ¥¡¥¤¥ëÈÖ¹æ¤Ç
158 .RB ` 1 "' ¤Þ¤¿¤Ï `" 2 '
159 ¤Ç¤¢¤ë¡£ \fIN\fP ¤ÏÀµ¤ÎÀ°¿ô¤Ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎÈÖ¹æ¤Ç¤¢¤ë¡£
161 .\"O A field specification of `\fB0\fR' denotes the join field. In most
162 .\"O cases, the functionality of the `\fB0\fR' field spec may be reproduced
163 .\"O using the explicit \fIM\fB.\fIN\fR that corresponds to the join field.
164 .\"O However, when printing unpairable lines (using either or \fB\-a\fR
165 .\"O or \fB\-v\fR options), there is no way to specify the join field using
166 .\"O \fIM\fB.\fIN\fR in \fIFIELD\-LIST\fR if there are unpairable lines in both
167 .\"O files. To give \fBjoin\fR that functionality, POSIX invented the
168 .\"O `\fB0\fR' field specification notation.
169 ¥Õ¥£¡¼¥ë¥É»ØÄê `\fB0\fP' ¤Ï join ¥Õ¥£¡¼¥ë¥É¤òɽ¤¹¡£
170 ¤Û¤È¤ó¤É¤Î¾ì¹ç¤Ï¡¢ `\fB0\fP' ¤Îµ¡Ç½¤Ï \fIM\fB.\fIN\fR ¤òÍѤ¤¤Æ
171 join ¥Õ¥£¡¼¥ë¥É¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤ä¤êÊý¤Ç¤âºÆ¸½²Äǽ¤Ç¤¢¤í¤¦¡£
172 ¤·¤«¤·¡¢ (\fB\-a\fP ¤ä \fB\-v\fP ¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤¿¤È¤¤Ë)
173 ¥Ú¥¢¤Ë¤Ê¤é¤Ê¤«¤Ã¤¿¹Ô¤âɽ¼¨¤¹¤ë¾ì¹ç¤Ï¡¢Î¾Êý¤Î¥Õ¥¡¥¤¥ë¤Ë
174 ¤½¤Î¤è¤¦¤Ê¹Ô¤¬¤¢¤ë¤È¡¢ \fIFIELD\-LIST\fR ¤Ç
175 \fIM\fB.\fIN\fR ¤ò»È¤¦¤ä¤êÊý¤Ç¤Ï
176 join ¥Õ¥£¡¼¥ë¥É¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡£
178 ¤Ë¤³¤Îµ¡Ç½¤òÍ¿¤¨¤ë¤¿¤á¡¢ POSIX ¤Ç
179 `\fB0\fR' ¥Õ¥£¡¼¥ë¥É»ØÄê¤Îµ½Ò¤¬È¯ÌÀ¤µ¤ì¤¿¡£
181 .\"O The elements in \fIFIELD\-LIST\fR are separated by commas or blanks.
182 .\"O Multiple \fIFIELD\-LIST\fR arguments can be given after a single \fB\-o\fR
183 .\"O option; the values of all lists given with \fB\-o\fR are concatenated
184 .\"O together. All output lines \- including those printed because of
185 .\"O any \fB\-a\fR or \fB\-v\fR option \- are subject to the specified
186 .\"O \fIFIELD\-LIST\fR.
187 \fIFIELD\-LIST\fP ¤Î³ÆÍ×ÁǤϥ³¥ó¥Þ¤Þ¤¿¤Ï¶õÇò¤Ç¶èÀÚ¤é¤ì¤ë¡£
188 °ì¤Ä¤Î \fB\-o\fP ¥ª¥×¥·¥ç¥ó¤Î¸å¤ËÊ£¿ô¤Î \fIFIELD\-LIST\fP
189 °ú¿ô¤ò»ØÄꤹ¤ë¤³¤È¤â½ÐÍè¤ë¡£ \fB\-o\fP ¥ª¥×¥·¥ç¥ó°Ê¹ß¤Î
190 Á´¤Æ¤Î¥ê¥¹¥È¤ÎÃͤϷë¹ç¤µ¤ì¤ë¡£
191 \fIFIELD\-LIST\fR ¤Î»ØÄê¤Ï¡¢
192 (\fB\-a\fP ¤ä \fB\-v\fP ¥ª¥×¥·¥ç¥ó¤ËͳÍ褹¤ë¤â¤Î¤â´Þ¤á)
193 Á´¤Æ¤Î½ÐÎϹԤËŬÍѤµ¤ì¤ë¡£
196 .\"O Use character \fICHAR\fR as the input and output field separator.
197 ÆþÎÏ¡¦½ÐÎϤΥե£¡¼¥ë¥É¶èÀÚ¤ê¤Ëʸ»ú \fICHAR\fP ¤òÍѤ¤¤ë¡£
199 .B \-v \fIFILE\-NUMBER
200 .\"O Print a line for each unpairable line in file \fIFILE\-NUMBER\fR (either
201 .\"O .RB ` 1 "' or `" 2 '),
202 .\"O instead of the normal output.
205 .RB (` 1 "' ¤Þ¤¿¤Ï `" 2 ')
206 ¤Î¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¡¢¥Ú¥¢¤Ë¤Ê¤é¤Ê¤«¤Ã¤¿¹Ô¤À¤±¤òɽ¼¨¤¹¤ë¡£
209 .\"O Print a usage message on standard output and exit successfully.
210 ɸ½à½ÐÎϤ˻ÈÍÑÊýË¡¤Î¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£
213 .\"O Print version information on standard output then exit successfully.
214 ɸ½à½ÐÎϤ˥С¼¥¸¥ç¥ó¾ðÊó¤ò½ÐÎϤ·¤ÆÀµ¾ï½ªÎ»¤¹¤ë¡£
217 .\"O Report bugs to bug-textutils@gnu.org.
219 .\"O Man page by Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>
220 ¥×¥í¥°¥é¥à¤Î¥Ð¥°¤Ë¤Ä¤¤¤Æ¤Ï bug-textutils@gnu.org ¤ËÊó¹ð¤·¤Æ¤¯¤À¤µ¤¤¡£
222 man ¥Ú¡¼¥¸¤Ï Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com> ¤¬ºîÀ®¤·¤Þ¤·¤¿¡£