Comments on: How to Use Awk for Text Filtering with Pattern-Specific Actions – Part 3 https://www.tecmint.com/awk-filter-text-or-string-using-patterns/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Mon, 12 Aug 2024 06:43:35 +0000 hourly 1 By: anonymous boi https://www.tecmint.com/awk-filter-text-or-string-using-patterns/comment-page-1/#comment-2182444 Thu, 20 Jun 2024 15:46:00 +0000 http://www.tecmint.com/?p=20346#comment-2182444 In reply to Anonymous.

You should start from Part 1, which explains all the symbols and concepts. Also, experiment with the code yourself.

]]>
By: anonymous boi https://www.tecmint.com/awk-filter-text-or-string-using-patterns/comment-page-1/#comment-2182443 Thu, 20 Jun 2024 15:43:23 +0000 http://www.tecmint.com/?p=20346#comment-2182443 Check the first tutorial; it covers the basics.

]]>
By: YueliangGu https://www.tecmint.com/awk-filter-text-or-string-using-patterns/comment-page-1/#comment-1847100 Mon, 18 Jul 2022 00:31:33 +0000 http://www.tecmint.com/?p=20346#comment-1847100 I found that it should use .* pattern to match all the characters before the $ character:

[root@telecom exer]# awk '/.*\$[2-9]\.[0-9][0-9]/ { print $1, $2, $3, $4, "*" ;} /.*\$[0-1]\.[0-9][0-9]/ {print ;}' food_prices.txt

1 Mangoes 10 $2.45 *
2       Apples                     20           $1.50
3       Bananas                    5            $0.90
4 Pineapples 10 $3.46 *
5       Oranges                    10           $0.78
6       Tomatoes                   5            $0.55
7       Onions                     5            $0.45
]]>
By: skittle https://www.tecmint.com/awk-filter-text-or-string-using-patterns/comment-page-1/#comment-1793975 Fri, 13 May 2022 08:40:34 +0000 http://www.tecmint.com/?p=20346#comment-1793975 What are the *'s for in the expressions? For example in:

$ awk '/ *$[2-9]\.[0-9][0-9] */ { print $1, $2, $3, $4, "*" ; } / *$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list

What is the * before the $ and the * before the / for?

]]>
By: Anonymous https://www.tecmint.com/awk-filter-text-or-string-using-patterns/comment-page-1/#comment-1348671 Wed, 29 Jul 2020 02:05:45 +0000 http://www.tecmint.com/?p=20346#comment-1348671 In reply to lethargos.

I know this is really late but I agree with you, I can’t find a good tutorial site that doesn’t just throw a bunch of code in your face and expect you to understand it.

]]>