多くの数値 (+2M) を含むファイル 'tbook1' があります。bash (Solaris / RHEL) で以下を実行する必要があります。
Do following:
Remove 1st and last 2 lines
Remove (,") & (")
Substitute (, ) with (,)
私は2つの方法を使用してそれを行うことができます:
Method1:
sed -e 1d -e 's/,"//g' -e 's/, /,/g' -e 's/"//g' -e 'N;$!P;$!D;$d' tbook1 > tbook1.3
method2:
tail -n +2 tbook1 | head -n -2 > tbook1.1
sed -e 's/,"//' -e 's/, //' tbook 1.1 > tbook1.2
どちらが優れているか、つまり、より高速で効率的 (リソースの使用) か知りたいですか?