输入:
创建表tbl(
int1 int,
vc1 varchar(5),
vc2 varchar(^ 6)
)
dakgdkagkdsa
asdajgdahsdha;
预期产出:
int1 int,
vc1 varchar(5),
vc2 varchar(^6)
答案 0 :(得分:0)
如果是带有sed
的文件sed 's/\([^(]*( \)\(.*)\)\( ).*\)/\2/;s/, /,\n/g' infile
如果它是var
使用bash
var="${var#*\( }";var="${var% )*}";printf "${var//, /,$'\n'}\n"
使用posix shell(破折号)
var="${var#*\( }";var="${var% )*}";var2="${var#*, }";printf "%s\n" "${var%%,*}," "${var2%,*}," "${var##*, }"