How can I delete the lines that exceed specific number of letters and characters from a text file ?For example: In this text file :         a;dskjshdkjhgsdlhb5451candsncas;ldjch;sdkjncl         zdkcjsd#c         adsaskad@#s;l35684ad;sjdikm;         ;okjilh@j         oieoigsb53454kdsjhcyavscjbkajlknscm;la,How can I delete automatically ( using a command line) all the lines that include only 8 letters and characters? I am asking this question because I have a sort of text files and I want to delete only the lines that have 8 (letters and characters) in it ( it is similar lines between all the files and have the same letters and characters).
Revising text file
text processing
Try using sed, . matches any character \{8\} tells it to match exactly 8 of them. the ^ says match from the beginning of the line and $ says match til the end of the line, the d says delete the line. sed '/^.\{8\}$/d' file > newfileor if you want to change the existing file, with GNU sed: sed -i '/^.\{8\}$/d' file If you want to delete empty lines as well the -e allows you to put multiple expressions in the same commandsed -i -e '/^.\{8\}$/d' -e '/^$/d'