LINUX cainiao... The teacher posted 100 questions, but not many. Can you help me...

Source: Internet
Author: User
LINUX cainiao... The teacher posted 100 questions, but not many. Can you help me... -- Linux general technology-Linux technology and application information. For details, refer to the following section. I have been studying LINUX for two days. I still have a big question... Let's take a look...
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
Lili 114 70
LinPin 203 59
Joey 108 53
WangLi 186 90
--------------------------------------------
Please write one command to merge the.txt and B .txt into a new file named c.txt, c.txt shoshould 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 United States 108 53
WangLi 22 female China 186 90
If there are a total of these six questions, I will have the second question... It is written as "sort-k 6 c.txt...
Big shrimps are in urgent need ~~~~~~~~~~~
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.