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

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
主站蜘蛛池模板: 济源市| 临泽县| 黔西| 吴江市| 岢岚县| 安平县| 大城县| 石柱| 韩城市| 衡阳县| 泰顺县| 元朗区| 丹寨县| 故城县| 商河县| 枣庄市| 山阴县| 呼伦贝尔市| 高安市| 晋中市| 宁陕县| 确山县| 唐山市| 青川县| 磐石市| 泾源县| 米易县| 和龙市| 安化县| 温泉县| 塔城市| 沂南县| 虞城县| 蛟河市| 陇川县| 襄樊市| 河西区| 资溪县| 衡阳市| 丁青县| 札达县|