我有一个[csv]文件,该文件具有重复的重复数据,即相同的数据打印了两次。我试过使用sort的uniq
,sort myfile.csv | uniq -u但是中没有变化myfile.csv,我也试过sudo sort myfile.csv | uniq -u但没有区别。
所以目前我的csv文件看起来像这样
a
a
a
b
b
c
c
c
c
c
我想看起来像
a
b
c
排序-u myfile.csv> tmp.csv; mv -f tmp.csv myfile.csv
—
Archemar
根据
—
Archemar
man sort,您无法“就地”排序。
您也可以尝试不依赖终端。你可以尝试,而不是这个在线工具textmechanic.com/text-tools/basic-text-tools/...
—
阿米娜Nuraini