- 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
推薦閱讀
- iOS Game Programming Cookbook
- 造個(gè)小程序:與微信一起干件正經(jīng)事兒
- Windows系統(tǒng)管理與服務(wù)配置
- R語言數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南
- Java虛擬機(jī)字節(jié)碼:從入門到實(shí)戰(zhàn)
- 零基礎(chǔ)學(xué)MQL:基于EA的自動(dòng)化交易編程
- Flash CS6中文版應(yīng)用教程(第三版)
- Python貝葉斯分析(第2版)
- SQL Server 2016數(shù)據(jù)庫應(yīng)用與開發(fā)
- Mastering JavaScript Design Patterns(Second Edition)
- 焊接機(jī)器人系統(tǒng)操作、編程與維護(hù)
- 并行編程方法與優(yōu)化實(shí)踐
- 硬件產(chǎn)品設(shè)計(jì)與開發(fā):從原型到交付
- Go語言入門經(jīng)典
- jQuery Mobile Web Development Essentials(Second Edition)