Results 1 to 5 of 5
hey.!
i want to write a command using grep ..
so that i can find all the words in my file having exactly 1 vowel.
i tried using grep -iw ...
- 11-14-2011 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 2
vowels - grep command
hey.!
i want to write a command using grep ..
so that i can find all the words in my file having exactly 1 vowel.
i tried using grep -iw ".\?[aeiou]\?" k.txt
but it dosnt' seem to work.
any suggestions on how to get this done ?
- 11-14-2011 #2
Homework questions are not allowed here. You should talk to your teacher or tutor if you're having difficulty with your coursework.
You definitely shouldn't use Google to search for examples of regular expression use, or consult the man page for grep, which has an extensive section on this
Linux user #126863 - see http://linuxcounter.net/
- 11-14-2011 #3Just Joined!
- Join Date
- Nov 2011
- Posts
- 2
i knw..
i just want some hint or suggestion on how to approach the question.
- 11-14-2011 #4Just Joined!
- Join Date
- Aug 2011
- Posts
- 6
A hint? RTFM.
I know that's rude and crude, but that's how the rest of us learned.
- 11-15-2011 #5Just Joined!
- Join Date
- Dec 2009
- Location
- California
- Posts
- 68
So, you've got a bunch of words in a file. Are they one per line? or is it like a normal text file with a bunch of sentences?
Assuming it's a bunch of sentences, you'll need to use a command to put each word on it's own line. Have a look at at "tr" for that.
Your grep command is too complicated. remove the "w". You do need the "i". In the grep man page, look for "class" of characters. You are on the right track with what you have, but the answer is less complex....


Reply With Quote