使用 csvkit 進行檔案堆疊
SpotifyData_PopularityRank6.csv 與 SpotifyData_PopularityRank7.csv 的檔案格式、欄位順序與整體資料結構相同。不過,前者包含排名第 6 的歌曲資訊,後者則包含排名第 7 的歌曲資訊。請將這兩個檔案透過堆疊合併為一個統一的檔案。
本練習屬於課程
在 Shell 中進行資料處理
練習說明
- 將
SpotifyData_PopularityRank6.csv與SpotifyData_PopularityRank7.csv堆疊在一起。把堆疊的輸出重新導向並儲存為名為SpotifyPopularity.csv的新檔案。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Stack the two files and save results as a new file
___ SpotifyData_PopularityRank6.csv SpotifyData_PopularityRank7.csv ___ SpotifyPopularity.csv
# Preview the newly created file
csvlook SpotifyPopularity.csv