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 |
What is echo $shell?
How to handle the delimiter unit seperator in Unix
Which is best institute for testing tool?
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.
What is the first line in a shell script?
How to find duplicate record in file using shell script?
0 Answers IBM, Saama Tech, Wipro,
how to read systems current date and time
What is the use of "$?" Sign in shell script?
Differentiate between ‘ and ” quotes.
Why are shell scripts used?
how to separate the even and odd number generated from one file to two separate file i.e. even numbers in file1.txt and odd numbers in file2.txt
Can you write a script to portray how set –x works?