Gentoo Archives: gentoo-user

From: Andrey Falko <ma3oxuct@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] confused on join(1)
Date: Sat, 24 May 2008 15:48:52
Message-Id: 350fc7cf0805240848t296848ffj2a869a1ee393414f@mail.gmail.com
In Reply to: [gentoo-user] confused on join(1) by Zhang Weiwu
1 2008/5/24 Zhang Weiwu <zhangweiwu@××××××.com>:
2 > Dear all
3 >
4 > I am learning to use join to manage data processing easier. I got two
5 > data files, they should join on field No. 9.
6 >
7 > But such simple join doesn't work. The output of join is 0 bytes. Feel
8 > surprised I size down both file size to contain only two records. Still
9 > fail.
10 >
11 > $ join -t $'\t' -j 8 a b
12 > [no output]
13 >
14 > Expect:
15 > [output 2 rows]
16 >
17 > I attached my two test case, hope someone can guide me through this. It
18 > maybe very simple case but I had scratched my head half an hour now.
19 >
20 > 2 365 江西省 吉安市 安福县 钱山乡 油市村村委会 360829202206 36082920220629 岩下 201 刘丽霞 赵金根 9/18/2007 王桂刚 1 2 0 0 0 0 0 5 4 35 10 4 61 32 2 1 0 2 0 0 0 0 2 2 0 2 4.4 0 4 10 0 0 0 4 4 0.4 0 10 1 4 40 2 20 1 0 1 0 1 0 0 25 0 0 0 4 0 0 0 2100 2 3 0 0 1 1 5 0 0 0 0 0 2 0 0 2 1 1 0 0 1 0 0 0 10331 8600 0 0 0 8600 1446 600 0 0 0 0 0 0 0 0 0 0 0 0 350 600 0 0 0 0 0 0 0 0 0 846 0 0 0 0 0 0 0 0 0 0 0 0 20 720 12 432 11.25 126 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 285 100 100 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9279 6229 0 1400 0 100 0 50 0 300 600 125 288 370 126 0 0 50 0 320 0 100 0 0 0 150 0 250 2000 0 1000 0 200 500 600 250 550 200 800 0 100 200 10031 0 0 0 0 0 0 0 0 0 0 0 365 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 0 1 0 1 5 8 10 39343 刘丽霞
21 > 3 379 江西省 吉安市 安福县 钱山乡 油市村村委会 360829202206 36082920220601 垅上 101 刘丽霞 赵金根 9/18/2007 宁纪生 1 3 0 0 0 0 1 4 2 64 30 28 5 3 1 0 2 1 0 0 0 2 2 0 1 5.5 0.5 5 16 0 0 0 5 5 0.5 2 15 0 0 100 4 30 1 0 1 0 1 1 0 30 0 0 0 4 1 1 1 3000 2 3 0 0 4 1 4 0 0 0 0 0 2 1 1 1 0 0 0 0 0 0 0 0 15630 8500 0 500 0 8000 6895 4100 2000 3200 1250 2000 0 0 0 0 0 0 0 0 450 900 150 300 0 0 0 0 0 0 0 2795 115 1400 67 800 0 0 0 0 0 0 0 0 30 1080 18 680 28 315 19 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 235 1000 500 500 0 0 500 500 0 0 0 0 0 0 0 0 0 0 0 0 9300 7000 1200 0 0 0 0 0 0 550 600 100 1000 150 100 50 0 50 0 200 0 50 0 50 0 400 0 0 2500 0 800 0 200 500 800 400 0 0 600 0 0 200 14430 0 0 0 0 0 0 0 0 0 0 0 379 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 0 1 0 1 4 8 9 39343 刘丽霞
22 >
23 > 839 330 "江西省" "吉安市" "安福县" "钱山乡" "油市村村委会" 360829202206 36082920220629 "岩下" 201 "刘丽霞" "赵金根" 09/18/07 "王桂刚" 1 35 2 1 4 4 3 3 14000 4000 1 3 2 2 3 3 3 4 4 3 3 3 3 3 2 3 3 2 3 3 3 3 4 3 3 3 4 4 3 2 2 2 4 2 3 4 4 4 3 3 3 3 4 3 3 4 3 3 3 3 2 2 3 2 2 3 2 2 2 1 3 0 1 2 1 2 3 3 2 0 2 0 1 1 1 2 4 4 1 7 1 5 3 3 3 4 39343 "刘丽霞"
24 > 844 383 "江西省" "吉安市" "安福县" "钱山乡" "油市村村委会" 360829202206 36082920220601 "垅上" 101 "刘丽霞" "赵金根" 09/18/07 "宁纪生" 1 64 2 0 0 0 0 0 0 0 4 3 3 2 4 4 3 3 2 2 3 4 4 2 3 3 4 4 4 4 3 4 4 4 4 4 3 4 4 4 4 3 4 4 4 4 4 3 4 4 4 4 4 4 3 1 2 3 1 3 3 2 1 3 2 1 1 1 4 0 1 4 1 3 3 3 1 3 2 0 1 2 0 0 4 4 1 6 1 6 4 4 4 4 39343 "刘丽霞"
25 >
26 >
27
28 I just tried: join -j 9 -t $'\t' testa testb and it appears to work. I
29 think the mistake is that you are counting from 0 instead of 1.
30 éí¢‹¬z¹b²Û z{h¢Šà™¨¥Šx%ŠË