我有一個文件:AWK和正則表達式從文件
first basket with apple
second basket with apricota
third basket with tomato
fourth basket with olives
fifth empty basket
我必須打印包含在端/ E,O,Y /每個1,3,5.N字母串的每個單詞。 結果必須是:蘋果,番茄,空。 我可以單獨1,3,5字符串,但不能在字符串每個字分開,並檢查它
awk '{if (NR % 2 != 0); {if (/(y|e|o)$/) print $0}}' inputfile
,並在結果
first basket with apple