- Bash Cookbook
- Ron Brash Ganesh Naik
- 136字
- 2021-07-23 19:17:36
Getting ready
Let's get ready for the exercise by creating some data sets which mimic common daily problems:
$ rm -rf testdata; mkdir -p testdata
$ echo "Bob, Jane, Naz, Sue, Max, Tom$" > testdata/garbage.csv
$ echo "Zero, Alpha, Beta, Gama, Delta, Foxtrot#" >> testdata/garbage.csv
$ echo "1000,Bob,Green,Dec,1,1967" > testdata/employees.csv
$ echo "2000,Ron,Brash,Jan,20,1987" >> testdata/employees.csv
$ echo "3000,James,Fairview,Jul,15,1992" >> testdata/employees.csv
Using these two CSVs, we are going to:
- Remove the extra spaces on the first two lines of garbage.csv
- Remove the last character from each line in garbage.csv
- Change the case of each character to uppercase in the first two lines of garbage.csv
- Replace Bob with Robert in employees.csv
- Insert a # at the beginning of each line in employees.csv
- Remove the exact date of birth column/field in each line of employees.csv
推薦閱讀
- Learn Blockchain Programming with JavaScript
- Java系統分析與架構設計
- Swift 3 New Features
- 自然語言處理Python進階
- Asynchronous Android Programming(Second Edition)
- 機器學習與R語言實戰
- Tableau 10 Bootcamp
- OpenResty完全開發指南:構建百萬級別并發的Web應用
- R Data Science Essentials
- 你好!Java
- Android項目實戰:博學谷
- Roslyn Cookbook
- 歐姆龍PLC編程指令與梯形圖快速入門
- Puppet Cookbook(Third Edition)
- Maya Programming with Python Cookbook