-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuestion1-ProblemSet2
More file actions
16 lines (10 loc) · 971 Bytes
/
Copy pathQuestion1-ProblemSet2
File metadata and controls
16 lines (10 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# The goal of this project is to write a Bash script that:
# 1. Counts the number of flights that were delayed more than 15 minutes into or out of Gainesville, FL (airport code GNV) during the timeframe covered by the dataset. (*2 points*)
tr ',' '\t' < flights.May2017-Apr2018.csv | grep 'GNV' |awk '$13 == 1.00 || $16 == 1.00 {print $0}' > FlightsDelayedGNV
# tr ',' '\t' -> tr translating or deleting characters: to change the CSV file for TSV
# grep 'GNV' -> to find the flights into or out Gainesville,FL
# awk '$13 == 1.00 || $16 == 1.00 {print $0}' -> to find in columns DEP_DEL15 ($13) and ARR_DEL15 flights delayed more than 15 minutes
wc -l FlightsDelayedGNV
# wc -l to count the number of flights that were delayed more than 15 minutes into or out of Gainesville, FL (airport code GNV) during the timeframe covered by the dataset
#Output: 1009 FlightsDelayedGNV
#Answer: There are 1009 flights delayed more then 15 minutes in or out of Gainesville, FL.