![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl: Match a line with multiple search patterns | Juha | Shell Programming and Scripting | 10 | 04-09-2008 02:43 AM |
| How to cut multiple patterns from a file? | Vijay06 | Shell Programming and Scripting | 5 | 11-26-2007 09:38 PM |
| Grep for Multiple patterns | WillImm123 | Shell Programming and Scripting | 7 | 03-01-2006 04:23 PM |
| Grep multiple patterns | malaymaru | Shell Programming and Scripting | 4 | 09-25-2005 02:20 AM |
| grep for multiple patterns | tselvanin | UNIX for Dummies Questions & Answers | 1 | 11-12-2003 07:43 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
AWK: Multiple patterns per line
Hi there,
We have been given a bit of coursework using awk on html pages. Without giving too much away and risking the wrath of the plagerism checks, I can say we need to deal with certain html elements. There may be several of these elements on one line. My question is, if there are more that one of these <tags> on a line, will awk pattern match the first one, perform the actions and then ignore the rest of the line? Or will it match the pattern, perform the action and then start where it left off, part way through the line? If it does skip the rest of the line, how can I impliment a solution that will look at all the elements on a line? Thank you for your help, Plavixo |
|
||||
|
We do not do homework, but perl regexp's allow multiple searches and you can use sed's 's/<regexp>/something else/g' for global replacement. In awk you probably want a loop Code:
while (match($0, <regexp>) )
{
$0="somechange" "old part of of $0 that you did not change "
}
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|