Search Results

Search: Posts Made By: Shell_Life
283,906
Posted By Shell_Life
Reborg, Using the same test data: a aa aaa...
Reborg,
Using the same test data:

a aa aaa
aaa aa a
aaa aa a aaa aa a aaa

Using your solution to find the number of 'a' words:

awk 'BEGIN {RS="a" } END { print NR }' FILE

Gives total...
283,906
Posted By Shell_Life
Using the same test data: a aa aaa aaa aa...
Using the same test data:

a aa aaa
aaa aa a
aaa aa a aaa aa a aaa

This solution does not work for the following case:

tr -s ' \011\012' '\n\n\n' < FILE | grep -c "a"

It gives the total...
283,906
Posted By Shell_Life
This solution does not work. Here is a...
This solution does not work.

Here is a sample file:

a aa aaa
aaa aa a
aaa aa a aaa aa a aaa


Here is one test:

tr -cs 'A-Za-z' '\n' < FILE | grep -c "aaa"


It gives the total of...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 10:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy