我有一個很大的csv文件,我想根據一定的條件導出部分 - 我需要保留所有列,但只導出csv的部分,其中summary_id
> 92900 。如何在BASH中寫這個命令?根據bash中的條件輸出重定向csv
$ head -n 10 snapshots.csv
id,station_id,status,available_bikes,available_docks,created_at,summary_id
32583548,465,Active,18,7,2015-12-12 12:40:07.325473,92982
32583549,466,Active,28,33,2015-12-12 12:40:07.330174,92982
32583550,467,Active,13,17,2015-12-12 12:40:07.334921,92982
32583551,468,Active,21,22,2015-12-12 12:40:07.339576,92982
32583552,469,Active,44,19,2015-12-12 12:40:07.344086,92982
32583553,470,Active,12,46,2015-12-12 12:40:07.34872,92982
32583554,471,Active,12,11,2015-12-12 12:40:07.353296,92982
32583555,472,Active,12,19,2015-12-12 12:40:07.357868,92982
32583556,473,Active,0,29,2015-12-12 12:40:07.362545,92982
'的csv'出口一部分?你能解釋一下嗎?你想如何做到這一點,出口作爲一個變量? (哪個變量) – Inian
您可以使用:'awk -F,'$ NF> 92900'file.csv> exported.csv' – anubhava
謝謝,'$ NF'是什麼? –