免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1231 | 回复: 0
打印 上一主题 下一主题

[系统管理] 把记录ID从单位数改为双位数,为什么使用JOIN不能合并记录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-10-19 15:00 |只看该作者 |倒序浏览
[root]# cat f1.txt
9 a
11 b

[root]# cat f2.txt
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11

使用以下方法可以合并文件记录
[root]# join f1.txt f2.txt  
9 a 9
11 b 11

可修改f2.txt的文件第一行内容为:
[root]# cat f1.txt
10 a
11 b

再使用相同方法,就不可以合并记录(没有输出)
[root]# join f1.txt f2.txt  
[root]#

join的版本为:
[root]# join --version
join (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel.

-------------
本人试验使用一个文件第一列从单位数开始递增,另一文件第一列从双位数开始递增,就不能合并记录。请问一下,有没有哪位知道是什么原因,或哪里的文档手册有说明。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP