我有两个 CSV 文件要连接到一列上,我正在使用 unix join
命令,我想在连接时忽略标题,我正在使用 --header
GNU core utils v8.21 中的选项,但我的产品机器有 core utils v8.4,--header
在 GNU core utils 8.4 中不可用,我无法升级生产机器中的 core utils。有没有办法跳过标题(第一行并加入文件)
join --header -t, -1 3 -2 2 <File1> <File2> -o 2.1,1.2,2.2,2.3,2.4,2.5,2.6,2.7
最佳答案
如果您无法使用--header
,请使用tail
来解决
join <(tail -n+2 file1) <(tail -n+2 file2)
关于bash - 忽略 join 命令中的 header (过时的 coreutils),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32496007/