shell - Removing lines having special characters using awk command -


i have text file sentences, words on each line. e.g.

hello  hi  how you? % $ 9 

i need remove lines above file contains non text characters. output should follows:

hello  hi  

i trying out using awk command follows:

awk '!/[%$0-9?]/' filename 

i able above file because know special characters in above sentence. but, file has list of special characters difficult write in awk.

i tried out below commands keeps lines have both alphabets , special characters.

awk '/[a-za-z]/' filename 

hence, please suggest me how write awk command keep lines don't have special characters or how keep lines have alphabets only.

thanks

awk '/^[a-za-z[:space:]]+$/' yourfile 

note $ usage.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -