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
Post a Comment