FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-24-2008, 03:37 PM
Zhang Weiwu
 
Default confused on join(1)

Dear all

I am learning to use join to manage data processing easier. I got two
data files, they should join on field No. 9.

But such simple join doesn't work. The output of join is 0 bytes. Feel
surprised I size down both file size to contain only two records. Still
fail.

$ join -t $' ' -j 8 a b
[no output]

Expect:
[output 2 rows]

I attached my two test case, hope someone can guide me through this. It
maybe very simple case but I had scratched my head half an hour now.
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 ??丽??
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 ??丽??
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 "??丽??"
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 "??丽??"
 
Old 05-24-2008, 03:48 PM
"Andrey Falko"
 
Default confused on join(1)

2008/5/24 Zhang Weiwu <zhangweiwu@realss.com>:
> Dear all
>
> I am learning to use join to manage data processing easier. I got two
> data files, they should join on field No. 9.
>
> But such simple join doesn't work. The output of join is 0 bytes. Feel
> surprised I size down both file size to contain only two records. Still
> fail.
>
> $ join -t $' ' -j 8 a b
> [no output]
>
> Expect:
> [output 2 rows]
>
> I attached my two test case, hope someone can guide me through this. It
> maybe very simple case but I had scratched my head half an hour now.
>
> 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 刘丽霞
> 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 刘丽霞
>
> 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 "刘丽霞"
> 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 "刘丽霞"
>
>

I just tried: join -j 9 -t $' ' testa testb and it appears to work. I
think the mistake is that you are counting from 0 instead of 1.
����z�b��z{h�����x%��
 
Old 05-24-2008, 05:29 PM
Zhang Weiwu
 
Default confused on join(1)

Zhang Weiwu wrote:
> Dear all
>
> I am learning to use join to manage data processing easier. I got two
> data files, they should join on field No. 9.
>
> But such simple join doesn't work. The output of join is 0 bytes. Feel
> surprised I size down both file size to contain only two records. Still
> fail.
>
> $ join -t $' ' -j 8 a b
> [no output]
>
> Expect:
> [output 2 rows]
>
> I attached my two test case, hope someone can guide me through this. It
> maybe very simple case but I had scratched my head half an hour now.
>

Looks like I simply didn't properly format the data, there perhaps are
un-necessary trailing spaces at the end of certain fields. Should be my
fault.
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 05:42 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org