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

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
主站蜘蛛池模板: 额尔古纳市| 芜湖市| 修武县| 商水县| 巧家县| 珠海市| 饶阳县| 陇南市| 安阳市| 中卫市| 云和县| 建瓯市| 广河县| 木兰县| 西华县| 祁东县| 鱼台县| 盖州市| 新安县| 江油市| 岚皋县| 专栏| 遂昌县| 常州市| 孝昌县| 平原县| 威远县| 开封县| 周宁县| 兴国县| 崇礼县| 霍城县| 新田县| 永春县| 灯塔市| 谢通门县| 清镇市| 洪江市| 历史| 偃师市| 芷江|