sed 替换双引号(“”)中的字符串中的数字
#!/bin/bash
cat spec.txt |
sed -e '
:begin
s/,"\([^",]*\)[0-9]\([^"]*\)"/,"\1@\2"/g
t begin
'
替换重复的字符只保留一个sed -r 's/(@)\1*\1/\1/g' spec.txt1
sed 替换双引号(“”)中的字符串中的数字
#!/bin/bash
cat spec.txt |
sed -e '
:begin
s/,"\([^",]*\)[0-9]\([^"]*\)"/,"\1@\2"/g
t begin
'
替换重复的字符只保留一个sed -r 's/(@)\1*\1/\1/g' spec.txt1