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...


The information of the two files should be redirect to
Third file in such a way that, the third file contain the
information like this.

1st line in third file should be from 1st file
2nd line in Third file should be from 2nd file
3rd line in Third file should be from 1st file
4th line in Third file should be from 2nd file
-
- so on

Answers were Sorted based on User's Feedback



The information of the two files should be redirect to Third file in such a way that, the third fi..

Answer / karthik c n

paste -d"\n" file1 file2 > file3

Is This Answer Correct ?    9 Yes 0 No

The information of the two files should be redirect to Third file in such a way that, the third fi..

Answer / amol

Unix utility sed can be used serve the purpose
Assuming file1.txt and file2.txt are two input files and
file3.txt is the third file.

Contents of the file1.txt
line 1
line 2
line 3

Contents of the file2.txt
LINE 1
LINE 2
LINE 3


After executing below mentioned command

sed -n -e '{
> R file2.txt
> p
> }' file1.txt > file3.txt


The third file file3.txt will be
line 1
LINE 1
line 2
LINE 2
line 3
LINE 3

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Shell Script Interview Questions

madhar chod unix ke 10 commands dhang se likh nahi sakta hai

0 Answers   Cap Gemini,


There are three departments A,B and C.Write a query to display the names of all the persons( in departments other than A) who are paid higher than the person receiving the lowest salary in DEPT A

1 Answers   Wipro,


How to know that your remote server is ruing smoothly or not in unix?

1 Answers  


What is difference between shell and bash scripting?

0 Answers  


How to pass an argument to a script?

0 Answers  


Explain about login shell?

0 Answers  


What are script files?

0 Answers  


what is the difference between cmp and diff commands

2 Answers   Amazon, CTS,


What is MUTEX?

1 Answers  


What is the difference between a 'thread' and a 'process'?

3 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,


What are the additional egrep symbols?

2 Answers  


Categories