Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is in Linux. Need help with the questions and what to write for the commands. Thank you in advance! CSC3320 System Level Programming Lab
This is in Linux. Need help with the questions and what to write for the commands. Thank you in advance!
CSC3320 System Level Programming Lab Assignment 4 - Part 2 (Post-Lab) Purpose: Practices on the grep. fgrep. egrep, sed, awk, and sort commands for text processing. Note: Please follow the instructions below, and write a report by answering the questions and upload the report (named as Lab4_P2_FirstNameLastName.pdf or doc) to the folder "Lab4_P2" of the Dropbox in the iCollege system. Please add the lab assignment NUMBER and your NAME at the top of your file sheet. The following table is from Wikipedia. It shows the eleven highest mountains in Georgia. Brasstown Bald, (summit),4784 feet,Union County Rabun Bald, (summit),4696, feet, Rabun County Dick's Knob, (summit),4620, feet, Rabun County Hightower Bald, (summit),4568,feet, Towns County Wolfpen Ridge, (ridge high point),4561, feet,Towns and Union Counties Blood Mountain, (summit),4458, feet,Union County Tray Mountain, (summit), 4430, feet,Towns County Grassy Ridge, (ridge high point),4420, feet, Rabun County Slaughter Mountain, (summit),4338 feet,Union County Double Spring Knob, (summit),4280, feet, Rabun County Coosa Bald, (summit),4280, feet,Union County In above table, each line contains 5 fields separated by comma. Open your terminal and connect to snowball server. After that, go to directory Lab4 (cd -Lab4) and please download the file " mountainList.txt" by the following command (internet access required): /home/yye10/public/mountainList.txt mountainlist.txt Be sure it succeeds using ls to see the file name "mountainList.txt listed. cp 8) Use sed to delete the lines where the mountains are only at Union County in "mountainList.txt". Sample Output Rabun Bald, (summit), 4696, feet, Rabun County Dick's Knob, (summit), 4620, feet, Rabun County Hightower Bald, (summit),4568, feet, Towns County Wolfpen Ridge, Iridge high point), 4561, feet, Towns and Union Counties Tray Mountain, (summit), 4430, feet, Towns County Grassy Ridge, (ridge high point), 4420, feet, Rabun County Double Spring Knob, (summit), 4280, feet, Rabun County 9) Use sed to remove the middle three fields in each line of "mountainList.txt". Hint: Think about the meaning of regex '[^]' sed -r 's/([^;]*){3},J,g' public/mountainList.txt Sample Output Brasstown Bald, Union County Rabun Bald, Rabun County Dick's knob, Rabun County Hightower Bald, Towns County Wolfpen Ridge, Towns and Union Counties Blood Mountain, Union County Tray Mountain, Towns County Grassy Ridge, Rabun County Slaughter Mountain, Union County Double Spring Knob, Rabun County Coosa Bald, Union County 10) Use awk to finish task 9). 11) Use sed to insert a new line "Table: Eleven highest mountains in Georgia" at the beginning of "mountainList.txt". 12) Use sort to print out the sorted lines in alphabetical order according to the names of mountains. 13) Use sort to print out the sorted lines in descending order according to the height of mountains. CSC3320 System Level Programming Lab Assignment 4 - Part 2 (Post-Lab) Purpose: Practices on the grep. fgrep. egrep, sed, awk, and sort commands for text processing. Note: Please follow the instructions below, and write a report by answering the questions and upload the report (named as Lab4_P2_FirstNameLastName.pdf or doc) to the folder "Lab4_P2" of the Dropbox in the iCollege system. Please add the lab assignment NUMBER and your NAME at the top of your file sheet. The following table is from Wikipedia. It shows the eleven highest mountains in Georgia. Brasstown Bald, (summit),4784 feet,Union County Rabun Bald, (summit),4696, feet, Rabun County Dick's Knob, (summit),4620, feet, Rabun County Hightower Bald, (summit),4568,feet, Towns County Wolfpen Ridge, (ridge high point),4561, feet,Towns and Union Counties Blood Mountain, (summit),4458, feet,Union County Tray Mountain, (summit), 4430, feet,Towns County Grassy Ridge, (ridge high point),4420, feet, Rabun County Slaughter Mountain, (summit),4338 feet,Union County Double Spring Knob, (summit),4280, feet, Rabun County Coosa Bald, (summit),4280, feet,Union County In above table, each line contains 5 fields separated by comma. Open your terminal and connect to snowball server. After that, go to directory Lab4 (cd -Lab4) and please download the file " mountainList.txt" by the following command (internet access required): /home/yye10/public/mountainList.txt mountainlist.txt Be sure it succeeds using ls to see the file name "mountainList.txt listed. cp 8) Use sed to delete the lines where the mountains are only at Union County in "mountainList.txt". Sample Output Rabun Bald, (summit), 4696, feet, Rabun County Dick's Knob, (summit), 4620, feet, Rabun County Hightower Bald, (summit),4568, feet, Towns County Wolfpen Ridge, Iridge high point), 4561, feet, Towns and Union Counties Tray Mountain, (summit), 4430, feet, Towns County Grassy Ridge, (ridge high point), 4420, feet, Rabun County Double Spring Knob, (summit), 4280, feet, Rabun County 9) Use sed to remove the middle three fields in each line of "mountainList.txt". Hint: Think about the meaning of regex '[^]' sed -r 's/([^;]*){3},J,g' public/mountainList.txt Sample Output Brasstown Bald, Union County Rabun Bald, Rabun County Dick's knob, Rabun County Hightower Bald, Towns County Wolfpen Ridge, Towns and Union Counties Blood Mountain, Union County Tray Mountain, Towns County Grassy Ridge, Rabun County Slaughter Mountain, Union County Double Spring Knob, Rabun County Coosa Bald, Union County 10) Use awk to finish task 9). 11) Use sed to insert a new line "Table: Eleven highest mountains in Georgia" at the beginning of "mountainList.txt". 12) Use sort to print out the sorted lines in alphabetical order according to the names of mountains. 13) Use sort to print out the sorted lines in descending order according to the height of mountainsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started