Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. 1 Using chipotle.tsv in the data subdirectory:
  2. i Look at the head and the tail, and think for a minute about how the data is structured. What do you think each column means? What do you think each row means? Tell me! (If you're unsure, look at more of the file contents.)
  3. ii How many orders do there appear to be? 1834
  4. iii How many lines are in the file? 4623
  5. wc
  6. iv Which burrito is more popular, steak or chicken? Steak = 368, Chicken = 553
  7. grep -c "Steak Burrito" chipotle.tsv
  8. v Do chicken burritos more often have black beans or pinto beans?
  9. MacBook-Pro:data Scott$ grep -c "Pinto Beans" chicburritocount.tsv
  10. 105
  11. MacBook-Pro:data Scott$ grep -c "Black Beans" chicburritocount.tsv
  12. 282
  13. 2 Make a list of all of the CSV or TSV files in the DAT7 repo (using a single command). Think about how wildcard characters can help you with this task.
  14. find . *.csv *.tsv
  15. 3 Count the number of occurrences of the word 'dictionary' (regardless of case) across all files in the DAT7 repo.
  16. grep -c "dictionary" . *.csv *.tsv
  17.  
  18. grep: .: Is a directory
  19. airlines.csv:0
  20. chipotle.tsv:0
  21. sms.tsv:1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement