Home Man
Search
Today's Posts
Register

This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in the UNIX for Beginners Questions & Answers forum.

joining files with different rows and colum

Tags
beginners, column, join, rows

 

 
Thread Tools Search this Thread
# 1  
Old 05-14-2009
joining files with different rows and colum

Hi all,

I have two files:

file one (9 rows, 3 columns):

A 1 x1
B 2 f1
C 3 f3
D 4 u5
E 5 l9
F 6 h6
G 7 g4
H 8 r4
I 9 s2

file two (4 rows, 1 column):

A
B
C
D

and I want output like this (4 rows, 3 columns):

file3:
A 1 x1
B 2 f1
C 3 f3
D 4 u5

Is there a way to do that, by using join or awk? When the rows are more than in those files, but still have 3 columns in file1 and 1 column in file2, how to do that? Tx
# 2  
Old 05-14-2009
go look at the "More UNIX and Linux Forum Topics You Might Find Helpful" at the top of this page and see if any of them fits your bill
# 3  
Old 05-23-2009
I guess the below can help you out...

Code:
grep -f file2 file1

 

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Joining 2 Files Daniel Gate Shell Programming and Scripting 4 02-06-2013 01:08 PM
Help with joining files and adding headers to files rrdavis Shell Programming and Scripting 8 05-24-2012 03:58 PM
Joining two files pandeesh UNIX for Dummies Questions & Answers 10 09-06-2011 12:27 PM
joining two or more files tomjones Shell Programming and Scripting 1 07-07-2010 03:37 PM
Deleting specific rows in large files having rows greater than 100000 manish2009 Shell Programming and Scripting 9 12-11-2009 12:17 PM
sed or awk to convert text files with recurring headings to rows and colum Bjoeboo Shell Programming and Scripting 5 05-07-2008 10:47 AM
Joining 2 CSV files together chachabronson UNIX for Advanced & Expert Users 3 05-06-2008 06:42 AM
Help with joining two files rjlohman Shell Programming and Scripting 3 09-27-2006 11:55 AM
joining files Manu UNIX for Dummies Questions & Answers 2 04-25-2005 12:24 PM
joining 2 files webtekie UNIX for Dummies Questions & Answers 1 10-21-2003 10:51 AM


All times are GMT -4. The time now is 09:04 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password