Assignment-3 Learn Filter Commands and Data Processing

 

Write shell scripts to do the following on a “stud” data file which contains rno,name,dob ( date of birth),m1,m2,m3 ( mark in three subjects out of 50). Create the “stud” file in the following format using any editor.

101|hari | 06-05-1985|30|40|35

102|devi | 03-08-1982|40|35|28

................................................................add more data in the same format

( you can write menu driven programs)

1. ( Hint :Use sort command )

a) List the students in the order of roll number
b) list the students in the order of name
c) list the students in the order of year of birth

2.( Hint: Use cut command )

a) List the roll number and name of all students.
b) List the roll number, name and m3.
c) List roll number, name and dob of all students.

3.(Hint :use cut ,and sort command)

a) List roll number, name m1 in the descending order of m1.
b)List the roll number , name and m2 of the top 5 performers in subject 2. ( use head)
c)List the roll number , name and m3 of the top 5 performers in subject 3. ( use tail)

4.(Hint :use cut , paste and sort command)

a) Create a new file stud1 from stud by cutting rno, name and year of birth from stud file.
b) List the stud1 file in the descending order of year of birth.
c) List rno, name and month of birth in the order of month of birth.

5.(Hint: use cut, sort and grep)

a) List the highest mark in m1( sort and cut).
Also find the students with this mark ( use grep)
b) read month of birth and list the students born in the month.
c)List the student who got more than 40 maks in m1 ( use regular expression)

Comments

Popular posts from this blog

CSL 204 OPERATING SYSTEM LAB KTU IV SEM CSE

FCFS and SJF

Shared Memory Inter-Process Communication ( IPC)