coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When specifying multiple elements with "-e" option of join command


From: Goto, Ryoichi
Subject: When specifying multiple elements with "-e" option of join command
Date: Thu, 30 Mar 2017 14:41:17 +0900

Hello,

With the CentOS 7 join command I would like to concatenate the contents of the 
next two files.

[File 1]
address@hidden
address@hidden
address@hidden
-
[File 2]
address@hidden 1 password 1
address@hidden 2 password 2

For the concatenation method, "For all the records in File 1, concatenate the 
values ​​of column 1 with the values ​​of column 2 and column 3 of the record 
of File 2 that matches column 1".
"However, it is a specification that columns 2 and 3 of records which are only 
in File 1 display fixed characters" 0 "and" PASSWORD 0 ".
For File 1, File 2, the results you want to obtain are as follows.

[Expected results]
address@hidden 0 PASSWORD 0
address@hidden 2 password 2
address@hidden 1 password 1


I tried executing the following command, but the record "address@hidden" which 
exists only in File 1 has two pairs of character strings specified by "-e" 
output.
$ Join -1 1 - o 0 2.2 2.3 - a 1 - e "0 PASSWORD 0" <(sort File 1) <(sort File 2)

[Actual result]
Jiro @ yahoo.jp 0 PASSWORD 0 0 PASSWORD 0
address@hidden 2 password 2
address@hidden 1 password 1

If you remove the double quotes from the command line you ran, "join: extra 
operator '/ dev / fd / 62'" and an unknown error will be displayed and say "- e 
0 - e PASSWORD 0" The syntax is also an error.

How do I specify correct results?
------------------------------------------
Oita Electronic Computer Center Co.,Ltd.
Oita city, Oita prefecture, Japan
Mail to: address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]