我尝试过跟随awk,但它没有按预期工作。
awk -v q="," '{ f1=$1; $1=""; print f1, q substr($0,2) q}' input.dat > output.dat
输入数据
12123 'QA test case 1' 'QA environment'
12234 'UAT test case 1' 'UAT environment'
预期输出
12123, 'QA test case 1', 'QA environment'
12234, 'UAT test case 1', 'UAT environment'