刚开始学LINUX,奋斗两天了,还有一道大题不会。。。大家帮着看看成么。。。
There are two files,"a.txt" (including 4 fields:name, age, gender and country) and "b.txt" (including 3 fields: name, No. and score),shown as follows:
---------------------------------------------
a.txt(name age gender country)
---------------------------------------------
Tom 21 male USA
Jack 22 male USA
Lily 20 female USA
LinPin 21 female China
Joey 21 male USA
WangLi 22 female China
---------------------------------------------
b.txt(name No. score)
---------------------------------------------
Tom 101 93
Jack 202 86
Lily 114 70
LinPin 203 59
Joey 108 53
WangLi 186 90
--------------------------------------------
1_Write one command to merge the a.txt and b.txt into a new file named c.txt, c.txt should be as follows:
c.txt(name age gender country No. score)
--------------------------------------------
Tom 21 male USA 101 93
Jack 22 male USA 202 86
Lily 20 female USA 114 70
LinPin 21 female China 203 59
Joey 21 male USA 108 53
WangLi 22 female China 186 90
--------------------------------------------
2_Sort the lines of c.txt according to the score:
3_Convert all the lower in c.txt to upper and saved as d.txt:
4_Print the number of male student:
5_Display only the name and country fields from c.txt:
6_Now replace all the "USA" with "America" in c.txt, and print out as follows:
output:
--------------------------------------------
Tom 21 male America 101 93
Jack 22 male America 202 86
Lily 20 female America 114 70
LinPin 21 female China 203 59
Joey 21 male America 108 53
WangLi 22 female China 186 90
一共这六道题,我就会第二道。。。写的是“sort -k 6 c.txt”也不知道对不对。。。
大虾们救救急啊~~~~~~~~~~~