Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


if i have 2 files file1 and file2....
file1 contains 2 columns like
b a
11 aa
12 as
13 ad
15 ag
11 ar
13 ah
15 ak

file2 contains
b c
10 ds
11 at
15 gh
15 jk
13 iu
11 fg
13 yy

can any 1 give me the program to display in this way?
a b c
aa 11 at
ar 11 fg
ad 13 iu
ah 13 yy
ag 15 gh
ak 15 jk

Answers were Sorted based on User's Feedback



if i have 2 files file1 and file2.... file1 contains 2 columns like b a 11 aa 12 as..

Answer / sudhir

paste file1 file2 | cut -f 2,3,4 -d " "

Is This Answer Correct ?    1 Yes 0 No

if i have 2 files file1 and file2.... file1 contains 2 columns like b a 11 aa 12 as..

Answer / pitambar mishra

Sorry Sudhir,
Your syntax is wrong.It should be
paste file1 file2|cut -d " " -f2,3,4
But this command is n't providing the correct result.
Piz try another.

Is This Answer Correct ?    0 Yes 0 No

if i have 2 files file1 and file2.... file1 contains 2 columns like b a 11 aa 12 as..

Answer / kirtiranjan sahoo

paste file1 file2 | cut -d" " -f2,3,4 | sort -n -k2

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

determine the output of the following command: echo ${new:-variable}

0 Answers  


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

0 Answers   Tech Mahindra,


What is the best scripting language?

0 Answers  


How to check if a directory exists?

0 Answers  


write a scwipt that a) takes exactly one argument, a directory name. b) if the number of argument is more or less than one,print a usage message c) if the argument is not adirectory, print another message d) for the given directory, print the five biggest files and the five files that were most recently modified. e) save the output to a file called q2output.

2 Answers  


is there any command to find user password?

4 Answers  


How would you replace the n character in a file with some xyz?

7 Answers  


What shell is bin sh?

0 Answers  


is this growing field and what is average package in this?

0 Answers  


If one dont know how to create a script then how he/she can use the QTP?

1 Answers  


How to calculate the number of passed arguments?

0 Answers  


give me some website where i can get unix and testing meterials

1 Answers  


Categories