cat $ line
"Product ID";"Product Name";"Price";"Description"
"310";"Ball;"30";"Some"
我的代码
while read line IFS=';' read pid pname price desc <<< $line
numn=0
If [ condition ]
((num++)
output_filename=comb/"$(echo $pid| tr -d '"').json3"
else
fi
此文件的结果为“ 310.json3”
我需要什么?
output_filename=comb/"$(echo $pid + ($num) | tr -d '"').json3"
Output= 310(1).json3
答案 0 :(得分:0)
可以创建文件名
output_filename=$(printf "comb/%u(%u).json3" $pid $num)
如果这是您的主要问题。