simple examples are deceptive
especially when the "eye" sort is different from reality

I had originally sorted the input files by
        sort -i file1 > f1
        sort -i file2 > f2
this results in record 19: preceding 1:
but when join gets those fields its sorting "19" vs "1"
and that order is "1" preceding "19"

so the correct sort before calling join is
        sort -i -t: -k1,1 file1 > f1
        sort -i -t: -k1,1 file2 > f2
using f1 and f2 you should get the expected results

On Mon, 9 May 2011 17:50:22 -0600 Bear Limvere wrote:
> I'm having a problem getting `join` to work on uwin.
> $ uname -a
> UWIN-W7 bear02 4.5/6.1 2010-06-08 i686 i686 32/32 UWIN

> I'm trying to "normalize" extracted data so I have all fields for import...

> file1 (field list) contents:
> 1:product_id
> 2:item_num
> 4:description
> 5:image
> 6:price
> 7:qty
> 8:label
> 9:fabric
> 10:condition
> 12:chest
> 13:arm
> 14:length
> 15:size
> 16:pattern
> 17:colors
> 18:style
> 19:dents
> 20:swatch

> file2 (extracted product) contents:
> 1:product_id:X_0806-17-18
> 2:ItemNumber:X0806-17-18
> 4:Description:Cool sleeveless
> 5:Image:X_0806-17-18.jpg
> 6:Price:29
> 8:Label:Ui-Maikai - Hawaii
> 9:fabric:cotton
> 10:Condition:Excellent
> 12:Chest_measure:46"
> 13:Arm_measure:sleeveless
> 14:Length:mid calf
> 16:Pattern:vertical stripe
> 17:Main_colors:indigo
> 18:Style:gathered at yoke
> 19:Dents:none
> 20:Swatch:0806_17-18.jpg

> $ join -t: -a1 -i -e "" -o 1.2,2.3 file1 file2
> yields the following:
> product_id:X_0806-17-18
> item_num:X0806-17-18
> description:Cool sleeveless
> image:X_0806-17-18.jpg
> price:29
> qty:
> label:Ui-Maikai - Hawaii
> fabric:cotton
> fabric:
> condition:
> chest:
> arm:
> length:
> size:
> pattern:
> colors:
> style:
> dents:
> swatch:

> I'm expecting the following (which I get using ksh on my linux box):
> product_id:X_0806-17-18
> item_num:X0806-17-18
> description:Cool sleeveless
> image:X_0806-17-18.jpg
> price:29
> qty:
> label:Ui-Maikai - Hawaii
> fabric:cotton
> condition:Excellent
> chest:46"
> arm:sleeveless
> length:mid calf
> size:
> pattern:vertical stripe
> colors:indigo
> style:gathered at yoke muu muu
> dents:none
> swatch:0806_17-18.jpg

> I've checked my line endings, and they're LF only. Been beating my head
> against this for most of the day. Is uwin's join broken, or...?

> Thanks, Bear
> -------------------------------------------
> Bear Limvere - Woodturner, Artist, Musician
> http://www.BearLimvere.com/ - http://www.StandingPeopleDesigns.com/
> "You give but little when you give of your possessions.
>  It is when you give of yourself that you truly give."
>  ~Kahlil Gibran
> Mitakuye Oyasin -- We are all RELATED! 

> _______________________________________________
> uwin-users mailing list
> uwin-users@research.att.com
> https://mailman.research.att.com/mailman/listinfo/uwin-users

_______________________________________________
uwin-users mailing list
uwin-users@research.att.com
https://mailman.research.att.com/mailman/listinfo/uwin-users

Reply via email to