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

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
主站蜘蛛池模板: 梁山县| 松滋市| 合作市| 苍梧县| 金华市| 滦平县| 扎鲁特旗| 肃南| 灯塔市| 绵竹市| 阳高县| 曲麻莱县| 云阳县| 永和县| 黄骅市| 来安县| 汕尾市| 榆社县| 开化县| 长海县| 大安市| 台州市| 沾益县| 平远县| 龙川县| 柞水县| 门源| 年辖:市辖区| 九台市| 麻栗坡县| 通江县| 荃湾区| 大丰市| 怀化市| 建德市| 星子县| 凌云县| 遂溪县| 福清市| 陆丰市| 嫩江县|