- Bash Cookbook
- Ron Brash Ganesh Naik
- 136字
- 2021-07-23 19:17:36
Getting ready
Let's get ready for this exercise by creating some data sets which mimic common daily problems:
$ rmdir testdata; mkdir -p testdata
$ echo "Bob, Jane, Naz, Sue, Max, Tom$" > testdata/garbage.csv
$ echo "Bob, Jane, Naz, Sue, Max, Tom#" >> 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 the birth column/field in each line of employees.csv
推薦閱讀
- JBoss Weld CDI for Java Platform
- JavaScript前端開發模塊化教程
- Microsoft Dynamics 365 Extensions Cookbook
- Reactive Programming with Swift
- Scratch 3.0少兒編程與邏輯思維訓練
- Visual C
- PHP+MySQL網站開發項目式教程
- Unreal Engine 4 Shaders and Effects Cookbook
- UML 基礎與 Rose 建模案例(第3版)
- Internet of Things with ESP8266
- Swift 4從零到精通iOS開發
- Spring Boot實戰
- Mastering AWS Security
- Mastering Apache Storm
- Python面試通關寶典