Я ищу что-то вроде этого:Добавление отдельных номеров в файле с использованием AWK или Grep
ИМЯ ФАЙЛА: fruites.txt
Apple a day keeps doctor away
but people dont like it............... 23 peoples found.
Banana_A.1 keeps u fit
and its very tasty.................... 12 peoples found.
Banana_B.2 juices is very good to taste
and most people like them
as well as consumed the most.......... 15 peoples found.
Anar is difficult to eat
as well as its very costly............ 35 peoples found.
grapes are easy to eat
and people like it the most........... 10 peoples found.
fruites are very healthy and improves vitamins.
Apple : The apple tree is a deciduous tree in the rose family best known for its sweet, pomaceous
fruit, the apple.
Banana_A.1: A banana is an edible fruit, botanically a berry, produced by several kinds of large
herbaceous flowering plants in the genus Musa.
Banana_B.2: A banana is an fruit, botanically a kerry, produced by several kinds of large
herbaceous flowering plants in the genus Musa.
Anar : The pomegranate, botanical name Punica granatum, is a fruit-bearing deciduous shrub or
small tree growing between 5 and 8 m tall.
Я хочу добавление всех народов, кроме найденных банан
ANS: 68 (23 + 35 + 10)
Я могу найти количество отдельно, но не смог вычитать их
Я попытался как этот
Grep -Е ".found" fruites.txt | AWK '{сумма + = $ 3} END {Печать сумма}'
АНС: 95 (68 + 27)
Grep -E "банан | .found" fruites.txt | grep -A1 "Банан" | grep -E ".found" | AWK '{сумма + = $ 3} END {печать сумма}'
И: 27 (только бананы)
Может кто-нибудь, пожалуйста, помогите
Почему так много downvotes? – Ramesh