- 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
推薦閱讀
- Reporting with Visual Studio and Crystal Reports
- SpringMVC+MyBatis快速開發與項目實戰
- Apache Hive Essentials
- 面向STEM的Scratch創新課程
- Production Ready OpenStack:Recipes for Successful Environments
- Learn Programming in Python with Cody Jackson
- Troubleshooting PostgreSQL
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- Learning ELK Stack
- Python數據結構與算法(視頻教學版)
- Learning Node.js for .NET Developers
- Zabbix Performance Tuning
- Spring 5 Design Patterns
- Instant Zurb Foundation 4
- JavaScript從入門到精通(視頻實戰版)