tag:blogger.com,1999:blog-8717593967327947380.post6534630698024158827..comments2023-10-17T07:40:15.063-07:00Comments on linuxjunk: Extracting part of a field in awknewhttp://www.blogger.com/profile/12129570461272996080noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8717593967327947380.post-69666327012401097822007-09-06T16:20:00.000-07:002007-09-06T16:20:00.000-07:00You could have a regular expression which matches ...You could have a regular expression which matches rule followed by 1 or more numbers and just output but there are a few problems I don't know how you'd get around with grep. The biggest is that grep stops after it finds the first match on a line (is there a way round this) and I have two ruleXXXs per line, both of which I want printed. The second is that I also want the final number on the line printed. Another problem is that grep would print ruleXXX rather than just the number, you could probably run it though grep again to strip rule off by just matching numbers.newhttps://www.blogger.com/profile/12129570461272996080noreply@blogger.comtag:blogger.com,1999:blog-8717593967327947380.post-78199619393308866592007-09-06T14:08:00.000-07:002007-09-06T14:08:00.000-07:00how would grep -o fare in this example?how would grep -o fare in this example?Niall Haslamhttps://www.blogger.com/profile/11853586434250627276noreply@blogger.com