我試圖查找和替換script.The現有的字符串的正則表達式會像如何在Linux中查找和替換正則表達式模式?
Input Sample : abc,c,efh,hj35,"2,6ag=a193",02_TG,",,,,10,,f,,",gf,g,f,,"1720a5",Thgf"18,dhg;_,2,53",0,hg,cj,cj
Expected Output : abc,c,efh,hj35,"-",02_TG,"-",gf,g,f,,"-",Thgf"-",0,hg,cj,cj
和我一樣替換字符串「 - 」我已經嘗試的代碼是
sed -e 's/".*"/"-"/g filename
但它不工作!
你想'的sed的/,/ -/g''呢? –
您的預期產出是多少?只有','需要改爲'-'? – Inian
http://importblogkit.com/2015/07/does-not-work/ – Biffen