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

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
主站蜘蛛池模板: 商城县| 文成县| 维西| 改则县| 巫山县| 东源县| 扎兰屯市| 乐东| 秦皇岛市| 宣威市| 都匀市| 礼泉县| 龙州县| 朝阳县| 夏津县| 镇坪县| 金华市| 聂荣县| 淮南市| 东丰县| 时尚| 富裕县| 广水市| 卓资县| 紫阳县| 革吉县| 奉新县| 大厂| 丰城市| 滦南县| 睢宁县| 囊谦县| 贵阳市| 河源市| 正镶白旗| 古丈县| 灵丘县| 洪江市| 扎鲁特旗| 高唐县| 乡宁县|