- 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
推薦閱讀
- Visual C++程序設(shè)計教程
- C# 7 and .NET Core Cookbook
- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- Practical Data Science Cookbook(Second Edition)
- Learning Informatica PowerCenter 10.x(Second Edition)
- Banana Pi Cookbook
- Python貝葉斯分析(第2版)
- Mastering Ext JS
- 前端HTML+CSS修煉之道(視頻同步+直播)
- HTML 5與CSS 3權(quán)威指南(第3版·上冊)
- ElasticSearch Cookbook(Second Edition)
- UI設(shè)計全書(全彩)
- INSTANT Apache ServiceMix How-to
- Python預(yù)測之美:數(shù)據(jù)分析與算法實戰(zhàn)(雙色)
- Mapping with ArcGIS Pro