example1.csvCSV刪除與重複的值的所有行中的一列
id1, value1
id2, value2
id3, value3
id1, value4
example2.csv
"06e04,0428","405872,8637110"
"06e04,0428","405872,8637111"
"06e04,0429","405872,8637110"
"06e04,0430","405872,8637110"
"06e04,0431","405872,8637111"
需要刪除與在列1重複的值的行,以輸出如下
需要輸出
example1_out。 CSV
id2, value2
id3, value3
example2_out.csv
"06e04,0429","405872,8637110"
"06e04,0430","405872,8637110"
"06e04,0431","405872,8637111"
有解決方案,以除去保留的重複記錄一個在本SO question重複記錄。但是在這種情況下,需要從輸出中排除列1具有重複值的所有行。
你已經標記了你的問題'shell'。你是不是指'bash'? – ghoti
@Grzesiek - 你能否添加nodejs答案? – user3206440
@ user3206440我很抱歉使用awk的選定解決方案更短。 – Grzesiek