I would like to find a way to use an iterative loop (for or while) to remove quotes (") from a dataset like the following:
"Macao,""China,Macao Special Administrative Region"",MAC
I know that there is the following way to remove them, which is actually more efficient, but it is important that it is an iterative statement in bash
sed -i -e 's/"//g' file.csv
Any idea?
uj5u.com熱心網友回復:
您可以使用while read -r來讀取行。使用引數擴展洗掉雙引號。
while read -r line ; do printf '%s\n' "${line//\"}" ; done < input
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/479317.html
