문제

I want to use vi to get rid of all characters in the file that are not spaces and newlines. The syntax I know, removes the entire line which is not what I want, how can I edit it? Thanks.

:1,$g:[a-z|A-Z]:d
도움이 되었습니까?

해결책

Global Substitution with Vim

With Vim, you can use a global substitution to remove everything but spaces and newlines. For example:

:%s/[^ \n]//g
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top