Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the beginning or end of line

Posted By: Adelfried Fischer     Category: Unix / Linux / Ubuntu     Views: 4687

Find all lines in a file with words longer than 4
characters, assuming that words are separated by spaces except at the beginning or end of line.

Code for Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the beginning or end of line in Unix / Linux / Ubuntu

echo Enter filename
read filename
grep -v ^[[:space:]] $filename | grep -v [[:space:]]$ | grep '.....'
  
Share: 



Adelfried Fischer
Adelfried Fischer author of Find all lines in a file with words longer than 4 characters, assuming that words are separated by spaces except at the beginning or end of line is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!