開始使用免費開始

使用 csvkit 進行檔案堆疊

SpotifyData_PopularityRank6.csvSpotifyData_PopularityRank7.csv 的檔案格式、欄位順序與整體資料結構相同。不過,前者包含排名第 6 的歌曲資訊,後者則包含排名第 7 的歌曲資訊。請將這兩個檔案透過堆疊合併為一個統一的檔案。

本練習屬於課程

在 Shell 中進行資料處理

檢視課程

練習說明

  • SpotifyData_PopularityRank6.csvSpotifyData_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
編輯並執行程式碼