我有一个文件parse.txt
parse.txt包含以下内容
remo/hello/1.0,remo/hello2/2.0,remo/hello3/3.0,whitney/hello/1.0,julie/hello/2.0,julie/hello/3.0
Run Code Online (Sandbox Code Playgroud)
我想使用parse.txt将output.txt文件作为(从最后一个到第一个的顺序)
julie/hello/3.0,julie/hello/2.0,whitney/hello/1.0,remo/hello3/3.0,remo/hello2/2.0,remo/hello/1.0
Run Code Online (Sandbox Code Playgroud)
我试过以下代码:
tail -r parse.txt
Run Code Online (Sandbox Code Playgroud) 我有一个文本文件名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.
嗨我有一个文件名test.txt
(standard input):8: <property name="ProcedureName" value="abc"/>
(standard input):7: <property name="PackageName" value="123abc"/>
(standard input):8: <property name="ProcedureName" value="bac"/>
(standard input):7: <property name="PackageName" value="bac123"/>
(standard input):8: <property name="ProcedureName" value="cde"/>
(standard input):7: <property name="PackageName" value="cd123"/>
(standard input):8: <property name="ProcedureName" value="b4u"/>
(standard input):7: <property name="PackageName" value="b4u234"/>
Run Code Online (Sandbox Code Playgroud)
我必须以下面的格式从此文件中仅grep packagename和procdeurename的值:进入o/p文件
abc/123abc
bac/bac123
cde/cd123
b4u/b4u234
Run Code Online (Sandbox Code Playgroud)
尝试削减和awk但无法得到