Hi All,
I want to search the string for vowel's occurence and find the no of occurence of each vowels, Could anyone help me out? This is urgent to me...I m new to Shell programming..
Thanks and Regards,
Nids:b:
Hi All,
I want to search the string for vowel's occurence and find the no of occurence of each vowels, Could anyone help me out? This is urgent to me...I m new to Shell programming..
Thanks and Regards,
Nids:b:
string=qwertyuiopaasdisiaiweryuyiyotp
printf "%s\n" "$string" | awk '
BEGIN { split("a e i o u",a," ") }
{
tolower($0)
for ( v in a ) {
n=$0
gsub( "[^"a[v]"]","",n)
print a[v],length(n)
}
}
'
echo "stringishere" | awk 'BEGIN{FS=""}
{
for (i=1;i<=NF;i++ ) {
if(tolower($i) ~ /a|e|i|o|u/ ){
arr[$i]++
}
}
}
END{
for ( i in arr ){
print arr , i
}
}
'
Thank u all, I have got the solutions..
Regards,
Nidhi