Rcz*_*one 1 bash shell awk sed
我有一个文本文件名file.txt包含
remo/hello/1.0,remo/hello2/2.0,,remo/hello3/3.0,whitney/hello/1.0,,,julie/hello/2.0,,,,remo/hello2/2.0,,remo/hello3/3.0,,
Run Code Online (Sandbox Code Playgroud)
我想删除文件中连续的重复逗号(,),删除输出文件后应该是这样的
output.txt的
remo/hello/1.0,remo/hello2/2.0,remo/hello3/3.0,whitney/hello/1.0,julie/hello/2.0,remo/hello2/2.0,remo/hello3/3.0,
Run Code Online (Sandbox Code Playgroud)
我试过下面的代码:
awk '!seen[$0]++' filename
Run Code Online (Sandbox Code Playgroud)
但没有成功.
请帮助TIA.