The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with using join command yahyaaa Shell Programming and Scripting 4 06-15-2008 01:16 PM
join (pls help on join command) summer_cherry Shell Programming and Scripting 1 12-31-2007 05:19 AM
Join Command Help jerome Sukumar Shell Programming and Scripting 0 01-25-2007 03:08 AM
Using Join Command Supial Shell Programming and Scripting 4 08-09-2005 01:12 AM
Join command unisam UNIX for Dummies Questions & Answers 4 07-28-2004 06:59 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-14-2009
ehshi1992 ehshi1992 is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 3
Complicated Join command!

Hi I have a serious issue when trying to join to files

so I have two files, one for meals and one for people

Meal1:Turkey:Potato Chips:Twinkie:Coke:5.95
Meal2:Ham & Cheeseoritos:Cookie:Sprite:6.49
Meal3:Vegetarian:Cheese Crackers:Brownie:Pepsi:5.75
Meal4:Tuna:Cheese Puffs:Eclairiet Coke:6.95


1234:John:Smith:Meal1:103
2345:Bob:Brown:Meal3:155
3456:Susan:Jones:Meal2:215
4567:Betty:Boop:Meal2:444
5678:Abbie:Normal:Meal3:122
6789:Carla:Carmes:Meal4:212
7890avidork:Meal1:355
8901:Joe:Johnson:Meal3:246
9012:Karen:Kook:Meal1:364



what im trying to do is join the two
i've tried

[join -1 4 -2 1 -t: people meals > orders]

but it does not seem to work, can anyone help please
  #2 (permalink)  
Old 10-15-2009
thegeek thegeek is offline
Registered User
  
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 440
What you expect it to do ?

What it is not doing ? What error you get ?!

Assuming you had given the order of file wrongly, 1st file 1st field, and 2nd file 4th field, and following works.
Code:
$ join -1 1 -2 4 -t: t1 t2
Meal1:Turkey:Potato Chips:Twinkie:Coke:5.95:1234:John:Smith:103
Meal3:Vegetarian:Cheese Crackers:Brownie:Pepsi:5.75:2345:Bob:Brown:155
Meal4:Tuna:Cheese Puffs:Eclairiet Coke:6.95:6789:Carla:Carmes:212
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0