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: name=shubham && echo ‘my name is $name’.

0 Answers  


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

0 Answers  


What is sed in shell script?

0 Answers  


what is the difference between writing code in shell and editor?

1 Answers  


What are the disadvantages of shell scripting?

0 Answers  


What is difference between bash and shell?

0 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


What is a shell script in windows?

0 Answers  


What is echo in shell?

0 Answers  


How do we delete all blank lines in a file?

0 Answers  


What is subshell?

0 Answers  


A file has multiple records each having three 30-bit long fields(field1,field2,field3).There is also a lookup file,LOOK_UP.dat.Now, we need to consider only the last ten digits of field1 and lookup the file LOOK_UP.dat. If there a match then field2 and field3 should replaced with corresponding data from the lookup file. otherwise that particular record,for which there is no match, should be stored in a seperate file.

2 Answers   Wipro,


Categories