官术网_书友最值得收藏!

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
主站蜘蛛池模板: 赫章县| 孟州市| 图木舒克市| 班戈县| 乐业县| 清远市| 溆浦县| 庆元县| 南开区| 璧山县| 进贤县| 麟游县| 庆安县| 牟定县| 庐江县| 耿马| 汝城县| 开鲁县| 南丰县| 宁陵县| 大埔区| 东丰县| 三江| 通化市| 乾安县| 长兴县| 桂林市| 关岭| 呼玛县| 休宁县| 攀枝花市| 定南县| 长宁县| 错那县| 锦州市| 北安市| 日照市| 武夷山市| 会泽县| 连州市| 来安县|