Awk

ph
Admin (토론 | 기여)님의 2019년 9월 5일 (목) 22:12 판
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
이동: 둘러보기, 검색

split

echo "12|23|11" | awk '{split($0,a,"|"); print a[3],a[2],a[1]}'

[1]

print all but first two columns

\$ # http://stackoverflow.com/a/2961994/766330
\$ cat somefile | awk '{$1=$2=""; print $0}’

아래가 더 나은듯

awk '{sub($1 FS,"")}7' YourFile

(스페이스도 없애준다) http://stackoverflow.com/a/31849899/766330

print except blank lines

awk NF main.txt > out.txt

[2]