我正在shell脚本中使用while循环来解析csv文件,该脚本具有以下格式的数据
ba04ba54,1234,MMS,"[""some"", ""somet2"", ""somet""]",21556,48834
代码:
while IFS=, read -r id mvid conkey values cretime modified;
do
echo $id,$mvid,$conkey,$values,$cretime,$modified
但是值分配有
"[""some""
代替
"[""some"", ""somet2"", ""somet""]" how to achieve this using shell script
答案 0 :(得分:0)
请您尝试以下。
awk 'match($0,/\"\[\".*\]\"/){print substr($0,RSTART,RLENGTH)}' Input_file