Professional Documents
Culture Documents
c. Store the list of first 3 rank holders for MCA course in merit.dat file
{ sort t : r k 5 student.dat | head -3 >marit.dat }
a. Display record of students who have not taken the course MCA
{ grep v MCA student.dat }
Question 2:
Product id
Product name
Quantity in hand
Price per unit
a. Display the information of products with name dove and lux
{ grep edove elux product.dat }
Question 3:
Basic pay
numeric
Insert at least five records in empdata.dat . Fields are separated by "-"
Write a command for the following.
a. Display all employees who are in department MKT
{ grep MKT empdata.dat }
c. Display the name of the employee with the highest basic pay
{ sort n t - k 6 empdata.dat |tail -1 }
Question 4
4. Create a file item.dat with the following fields having the mentioned type
of values
Field Name
Data Type
Item code
Numeric
Item name
Character
Price
Numeric
Quantity
Numeric
Insert at least five records in item.dat . Fields are separated by ":"
Write a command for the following.
a. Sort items according to their prices
{ sort n t : k 3 item.dat }
D Display the records where the item name begins with "P"
{ cut d : f 2- item.dat | grep ^p }
6. Create files f1,f2 and f3, where f1 contains names of courses offered by
college A, f2 contains names of courses offered by college B, f3 contains
names of courses offered by college University.
Write a command for the following :
a. Count the number of courses offered by University
B .Display the list of courses offered by University, but not offered by college A
Question 7
7. Create files f1, f2 and f3, where f1 contains names MCA colleges in
Mumbai, f2 contains names of MCA colleges in navi mumbai and f3 contains
names of MCA colleges that participated in St.Marys techfest.
a. Count the number of colleges in Navi mumbai.
c. Display college list from Mumbai who did not participate in techfest.
Question 5
5. Create a file student.dat with the following fields separated by ":" having
the below mentioned fields
Field Name
Data Type
Roll No
Numeric
First Name
Character
Last Name
Character
Date of Birth
dd-mm-yyyy
Marks out of 600 Numeric
Grade
character (A,B or C)
Insert at least 5 records and write a command for the following :
a. Sort the data on first name only
c. Display the first name of the student with the lowest marks
{ sort n t : k 5 student.dat |head -1 }