使用 csvkit 列印欄位標題
只用 csvkit 就有很多方式可以預覽資料(例如 csvlook、csvstat 等)。然而,如果你只想知道資料中各欄位的位置與名稱,直接列印一串欄位標題會更容易。讓我們為資料檔 Spotify_MusicAttributes.csv 列印欄位標題。
本練習屬於課程
在 Shell 中進行資料處理
練習說明
- 使用
csvkit指令,在主控台列印資料檔Spotify_MusicAttributes.csv的欄位標題清單。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Check to confirm name and location of data file
ls
# Print a list of column headers in data file
___ ___ Spotify_MusicAttributes.csv