Lab09
.docx
keyboard_arrow_up
School
Langara College *
*We aren’t endorsed by this school
Course
1280
Subject
Computer Science
Date
Apr 3, 2024
Type
docx
Pages
2
Uploaded by raman16894
Lab 09 – Search & Pattern Matching using grep
Objective
●
To understand the behaviour of grep
on a CSV file.
Resources Needed
●
PC with Ubuntu 20.04 LTS or higher installed, OR
●
Ubuntu 20.04 LTS or higher installed as a VirtualBox or VMware virtual machine, OR
●
A running instance of Ubuntu 20.04 LTS or higher on AWS
About the Lab
Most Linux administration tasks involve manipulating text files (configuration files, log files, text-based content, etc.). Linux shell commands are designed to work with text streams and are very convenient in dealing with text-based data.
In this lab, you will be practicing how to extract information using grep
from the data file tuition.csv
.
The Task
For all questions, you are expected to write a one-line bash
command (but you can use semi-colon ‘;’ to string commands together).
Commands allowed:
tail, grep, cut, sort, wc, |
.
1.
Show the count of only the data lines in the file (skip the header lines)
●
grep -c "^AY" tuition.csv
2.
Show the count of all the colleges in the file.
●
grep -c "College" tuition.csv
3.
Show the count of all the institutes in the file.
●
grep -c "Institute" tuition.csv
4.
Show the count of all the teaching-intensive universities in the file.
●
grep -c "Teaching-Intensive University" tuition.csv
5.
Show the count of all the research-intensive universities in the file.
●
grep -c "Research-Intensive University" tuition.csv
6.
Output all unique institution names, regardless of College or Institute or University.
●
tail -n +7 tuition.csv | cut -d',' -f4 | sort -u
7.
Find all data lines that contain Langara
●
grep "Langara" tuition.csv
8.
Display the names of colleges
in the Mainland/Southwest
region?
Page 1 of 2
●
grep "College" tuition.csv | grep "Mainland/Southwest" | cut -d',' -f4 | sort -u
9.
For the 2019/20 year, show only school names
and tuition amounts
, sorted in ascending order of
school names
●
grep "AY 2019/20" tuition.csv | cut -d',' -f4- | sort
10. Use grep find all institutions that have the tuition between 20,000 to 30,000
●
grep -E '"\$(2[0-9],\d{3}|30,000)"' tuition.csv
Submission: What to hand in
Upload the edited document Lab09.docx
(which includes all your answers) to Brightspace.
Submission: When to hand in
Before midnight (11:59 PM) tomorrow.
Page 2 of 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Downloads/
CSE110 Lab Assignment 7 (Sortin x
English
O localhost:8888/notebooks/Downloads/CSE110%20Lab%20Assignment%207%20(Sorting%20and%20Searching).ipynb
Cjupyter CSE110 Lab Assignment 7 (Sorting and Searching) Last Checkpoint: 8 minutes ago (autosaved)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Not Trusted
Python 3 O
• Run
с
Markdown
for i in range(len(my_list)):
for j in range(len(my_list)):
if my_list[i]>my_list[j]:
another_var=my_list[i]
my_list[i]=my_list[j]
my_list[j]=another_var
return my list
print('output: ' , bubble_sort([10,1,20,3,6,2,5,11,15,2,12,14,17,18,29]))
output: [29, 20, 18, 17, 15, 14, 12, 11, 10, 6, 5, 3, 2, 2, 1]
Task 4
Suppose you have a sitting arrangement of the students who will give the final exam in a list. The list contains the last two digits of their student ID as given
below.
sitting_list = [10,30,20,70,11,15,22,16,58,100,12,56,70,80]
Now you want to organize the sitting arrangement of the students in your own way. You decide to sort all the…
arrow_forward
cOMPUTER SCIENCE
VS2013How to remove the edmx file from the project and create a new one?
arrow_forward
Discuss the principles behind Linux containers and technologies like Docker.
arrow_forward
This is not a complex question don't reject plz.
Computer Science
Objective:To add scripting to the existing web page and work with JavaScript Es-6 features. The ES-6 concepts like class, object, getter and setter methods.
Problem Description:Genteel Software Solution is one of the famous software companies. They plan to increase the salary of their employees based on their experience.You being their software consultant have been approached to develop web application to implement the functionality to manage the salary of the employees.
Following are the files that contain code snippets
index.html
HTML for webpage (complete implementation is given for you). You only have to run this. No change needs to be done in this file.
script.js
Add your code to this file for the functions given.
Procedure to complete the exercise
Class
Properties
Methods
Employee
employeeIdemployeeNamesalaryexperience
Include the getters and setters method for all the attributes.…
arrow_forward
None
arrow_forward
From 1985 through 1998, new Apple computers used a proprietary file system called HFS (Hierarchical File System). With the release of Mac OS 8.1 in 1998, Apple began transitioning to a new version of HFS called HFS Plus (or HFS Extended). HFS Plus was finally replaced in 2017 when Apple introduced APFS (Apple File System) with the release of Mac OS 10.12.4 (High Sierra). Unlike HFS and HFS Plus, which were originally developed for the era of floppy disks, APFS is optimized for solid-state drive storage and also supports encryption, snapshots, and increased data integrity. Using Autopsy, import the APFS.img drive image located in the Data Recovery Evidence folder and attempt to recover at least one additional patent file
need help
arrow_forward
Chrome File Edit View History Bookmarks Profiles Tab Window Help
FIU FIU Canvas - FIU Canvas
← → C
X PT Syllabus for COP2210 RVD 122 X zy Section 5.17 - COP 2210: Progr X
learn.zybooks.com/zybook/FIUCOP2210Davis Fall 2022/chapter/5/section/17
=zyBooks My library > COP 2210: Programming I home > 5.17: More string operations
Censored
Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn cat.",
then output is:
429408.2778776.qx3zqy7
1 import java.util.Scanner;
2
Ex: If userInput is "Dang, that was scary!", then output is:
Dang, that was scary!
Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report
"Program end never reached." The system doesn't print the test case that caused the reported message.
3 public class CensoredWords {
4
5
6
7
8
9
10
11
12
13
14
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
String…
arrow_forward
Linux ubuntu :
Discuss the advantages and disadvantages of running containers (For example snap) instead of installing with apt.
arrow_forward
Explain your reasoning and the factors that led you to make each decision below. Debate whether or not the following are copyright infringements or fair uses. 1. You are adapting the popular movie "Pirates of the Caribbean" into a video game. Second, you should cite any images that were utilised in your report that were protected by copyright. Third, your capstone project should include setting up and running an Apache server. Copying and reselling original music CDs to the public after their first release. (Highlight two responses to this assertion).
arrow_forward
1. Create a new script in Octave Editor.
2. Save script file as octave prac1.m
3. Type a comment (% or #) and your first name and last name
4. Type a comment (% or #) and your student number
5. Set the range of the 'xi-axis to be 0 to 180 or 2pi. Use a linear spacing of 0.1
6. Plot 3 graphs on the same figure: sin(x), 1+ sin(x), cos(x)
7. Add labels: X-axis and y-axis
8. Add a legend
9. Add a Title
10. Use different colours for the three graphs
11. Use different linestyles for the three graphs
arrow_forward
Introduction to web Development
arrow_forward
Orac8-2024.pdf
X
ChatGPT
C
Adobe Acrobat: PDF edit, convert, si
Tools
prac8-2024
x
G different types fA x +
chrome-extension://efaidnbmnnni...
0
Share
C
2 Bulk SMSing Program
Sometimes clubs/group leaders send SMSS to their members about upcoming events. (I
am sure you have all been receiving SMS's regarding COVID-19 and the precautions we
should all take.) To limit the cost they would like to remove all the vowels in the message,
unless the word starts with a vowel, to limit the number of SMSs sent. Duplicate spaces
should also be removed. They would also like to have the message in Uppercase letters
and before each message they include the club name (with no vowels removed). The user
should also be informed of the length of the message.
Develop a program that reads in a normal description of a message and displays the
corresponding Bulk SMS in UPPERCASE letters. The program must continue to accept
adverts until the user indicates that they would like to terminate or exit the program.…
arrow_forward
QUESTION 8
Describe the difference between a text editor and an IDE
For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).
BIUS
Paragraph
Arial
10pt
QUESTION 2
Document markup is a notation method that defines
O how particular pieces of information are meant to be formatted.
O provides program instructions to the computer
the errors found in a document.
O the best way to create a document.
QUESTION 3
arrow_forward
Project 8-1:
HANDS-ON PROJECTS
Research Antivirus Software
For Windows machines, the built-in Windows Defender is considered to be a fairly decent solution for home users, but it does have inherent weaknesses. Several good antivirus solutions are available on the market today, some of which is OS agnostic (meaning they work for multiple operating systems)and some of which are customized to a specific OS. Many also have free versions. In this project, you research options for two different operating systems:
From the following list, select two operating systems for which you will research antivirus
options: Windows, Linux, OS X, Android, Chrome OS, or UNIX.
Research and select three antivirus solutions for your chosen operating systems. Compare
features, cost, reported effectiveness, and feedback from reviewers.
Create a table or spreadsheet comparing the pros and cons of each alternative. Which
would you choose and why?
arrow_forward
Font
DS XX ENGLISH (SOUTH AFRICA)
ere to search
Paragraph
Of
G
3.2 Suppose that you are a network engineer for Limpopo connexion company, a number of users
have complained about being unable to access the electronic email, some getting their inboxes flooded.
Write a report to Limpopo connexion management identifying the underlying problem and how it can
be addressed.
a
Styles
90
TFT
6°C
6
P
arrow_forward
On what Linux distribution does the Ubuntu Linux distribution build its foundation?
arrow_forward
What are the key distinctions between.DLL NET's and EXE files? ?
.
arrow_forward
Downloads/
CSE110 Lab Assignment 7 (Sortin x
O localhost:8889/notebooks/Downloads/CSE110%20Lab%20Assignment%207%20(Sorting%20and%20Searching).ipynb
C jupyter CSE110 Lab Assignment 7 (Sorting and Searching) Last Checkpoint: 4 hours ago (unsaved changes)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Trusted
Python 3 O
+
> Run
Markdown
In [ ]:
Task 7
Write a python program that takes two lists from the user, merges the two lists, sorts the resulting list, and then finds the median of the elements in the two
lists.
========:
=======
Sample Input 1
list_one = [1, 2, 1, 4]
list_two = [5, 4, 1]
Sample Output 1
Sorted list = [1, 1, 1, 2, 4, 4, 5]
Median = 2
========
Sample Input 2
list_one = [1, 7, 9, 10]
list_two = [2, 7, 6, 5]
Sample Output 2
Sorted list = [1, 2, 5, 6, 7, 7, 9, 10]
L OneDrive
Median = 6.5
Screenshot saved
In [ ]: #todo
The screenshot was added to your
OneDrive.
5:52 PM
a 4)
12/27/2021
arrow_forward
import android.os.Bundle
import android.os.PersistableBundle
import android.view.View
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
class TicTacToeActivity : AppCompatActivity(),View.OnClickListener {
// TODO (suggested): maintain a reference to a TicTacToe object
overridefunonCreate(savedInstanceState:Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_tictactoe)
// TODO (suggested): get the player's name, symbol, and the first move choice from the activity's intent; use them to instantiate a TicTacToe game; decide whether the computer should play based on the first move choice
// TODO (suggested): get a reference to the TextView "player info" area; update the TextView with the player's name and symbol
// TODO (suggested): using a loop and button tags, update their texts and "onClick" listeners to TicTacToeActivity; remember to disable the button if…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- Downloads/ CSE110 Lab Assignment 7 (Sortin x English O localhost:8888/notebooks/Downloads/CSE110%20Lab%20Assignment%207%20(Sorting%20and%20Searching).ipynb Cjupyter CSE110 Lab Assignment 7 (Sorting and Searching) Last Checkpoint: 8 minutes ago (autosaved) Logout File Edit View Insert Cell Kernel Widgets Help Not Trusted Python 3 O • Run с Markdown for i in range(len(my_list)): for j in range(len(my_list)): if my_list[i]>my_list[j]: another_var=my_list[i] my_list[i]=my_list[j] my_list[j]=another_var return my list print('output: ' , bubble_sort([10,1,20,3,6,2,5,11,15,2,12,14,17,18,29])) output: [29, 20, 18, 17, 15, 14, 12, 11, 10, 6, 5, 3, 2, 2, 1] Task 4 Suppose you have a sitting arrangement of the students who will give the final exam in a list. The list contains the last two digits of their student ID as given below. sitting_list = [10,30,20,70,11,15,22,16,58,100,12,56,70,80] Now you want to organize the sitting arrangement of the students in your own way. You decide to sort all the…arrow_forwardcOMPUTER SCIENCE VS2013How to remove the edmx file from the project and create a new one?arrow_forwardDiscuss the principles behind Linux containers and technologies like Docker.arrow_forward
- This is not a complex question don't reject plz. Computer Science Objective:To add scripting to the existing web page and work with JavaScript Es-6 features. The ES-6 concepts like class, object, getter and setter methods. Problem Description:Genteel Software Solution is one of the famous software companies. They plan to increase the salary of their employees based on their experience.You being their software consultant have been approached to develop web application to implement the functionality to manage the salary of the employees. Following are the files that contain code snippets index.html HTML for webpage (complete implementation is given for you). You only have to run this. No change needs to be done in this file. script.js Add your code to this file for the functions given. Procedure to complete the exercise Class Properties Methods Employee employeeIdemployeeNamesalaryexperience Include the getters and setters method for all the attributes.…arrow_forwardNonearrow_forwardFrom 1985 through 1998, new Apple computers used a proprietary file system called HFS (Hierarchical File System). With the release of Mac OS 8.1 in 1998, Apple began transitioning to a new version of HFS called HFS Plus (or HFS Extended). HFS Plus was finally replaced in 2017 when Apple introduced APFS (Apple File System) with the release of Mac OS 10.12.4 (High Sierra). Unlike HFS and HFS Plus, which were originally developed for the era of floppy disks, APFS is optimized for solid-state drive storage and also supports encryption, snapshots, and increased data integrity. Using Autopsy, import the APFS.img drive image located in the Data Recovery Evidence folder and attempt to recover at least one additional patent file need helparrow_forward
- Chrome File Edit View History Bookmarks Profiles Tab Window Help FIU FIU Canvas - FIU Canvas ← → C X PT Syllabus for COP2210 RVD 122 X zy Section 5.17 - COP 2210: Progr X learn.zybooks.com/zybook/FIUCOP2210Davis Fall 2022/chapter/5/section/17 =zyBooks My library > COP 2210: Programming I home > 5.17: More string operations Censored Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn cat.", then output is: 429408.2778776.qx3zqy7 1 import java.util.Scanner; 2 Ex: If userInput is "Dang, that was scary!", then output is: Dang, that was scary! Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message. 3 public class CensoredWords { 4 5 6 7 8 9 10 11 12 13 14 public static void main (String [] args) { Scanner scnr = new Scanner(System.in); String…arrow_forwardLinux ubuntu : Discuss the advantages and disadvantages of running containers (For example snap) instead of installing with apt.arrow_forwardExplain your reasoning and the factors that led you to make each decision below. Debate whether or not the following are copyright infringements or fair uses. 1. You are adapting the popular movie "Pirates of the Caribbean" into a video game. Second, you should cite any images that were utilised in your report that were protected by copyright. Third, your capstone project should include setting up and running an Apache server. Copying and reselling original music CDs to the public after their first release. (Highlight two responses to this assertion).arrow_forward
- 1. Create a new script in Octave Editor. 2. Save script file as octave prac1.m 3. Type a comment (% or #) and your first name and last name 4. Type a comment (% or #) and your student number 5. Set the range of the 'xi-axis to be 0 to 180 or 2pi. Use a linear spacing of 0.1 6. Plot 3 graphs on the same figure: sin(x), 1+ sin(x), cos(x) 7. Add labels: X-axis and y-axis 8. Add a legend 9. Add a Title 10. Use different colours for the three graphs 11. Use different linestyles for the three graphsarrow_forwardIntroduction to web Developmentarrow_forwardOrac8-2024.pdf X ChatGPT C Adobe Acrobat: PDF edit, convert, si Tools prac8-2024 x G different types fA x + chrome-extension://efaidnbmnnni... 0 Share C 2 Bulk SMSing Program Sometimes clubs/group leaders send SMSS to their members about upcoming events. (I am sure you have all been receiving SMS's regarding COVID-19 and the precautions we should all take.) To limit the cost they would like to remove all the vowels in the message, unless the word starts with a vowel, to limit the number of SMSs sent. Duplicate spaces should also be removed. They would also like to have the message in Uppercase letters and before each message they include the club name (with no vowels removed). The user should also be informed of the length of the message. Develop a program that reads in a normal description of a message and displays the corresponding Bulk SMS in UPPERCASE letters. The program must continue to accept adverts until the user indicates that they would like to terminate or exit the program.…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning