There is a record with fields namely name,roll
no.,salary,grade etc.Now,write a script to create a file
with multiple records have same combination of fields but
with unique roll numbers.The script should work for
different names in the input file.
Answer / sabhapathi
Don't mind my answer is lengthy....
Let file name be employee
name, rollno., salary, grade
cut each of records in each field to temp files as follows:
-----------------------------------------------------------
cut -f1 employee > /sm.tmp.$$
cut -f2 employee > /sn.tmp.$$
cut -f3 employee > /so.tmp.$$
cut -f4 employee > /sp.tmp.$$
Paste them as required in to another file as follows
----------------------------------------------------
paste /sn.tmp.$$ /sm.tmp.$$
paste /sn.tmp.$$ /so.tmp.$$
paste /sn.tmp.$$ /sp.tmp.$$
| Is This Answer Correct ? | 5 Yes | 2 No |
How to get the first line from a file using just the terminal?
In shell scripting if text is surrounded by single quotes what does it denotes?
What happens on a system call?
How do we create command aliases in a shell?
Is shell script a programming language?
write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?
Explain about return code?
c program to check whether all the directories in the path exists has read and write permission
What are the 3 standard streams in linux?
Dear All, Can anybody tell me how to predefind no. of selected rows from a text file.
How to get the 3rd element/column from each line from a file?
How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.