Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: regex to match the following

by cool (Scribe)
on May 08, 2007 at 09:20 UTC ( #614104=note: print w/replies, xml ) Need Help??


in reply to regex to match the following

Hope this small piece would of some help...Because your file has uniform pattern so without regex also this can be tackled

#! /usr/bin/perl -w use strict; open (FH,"infile") or die "File cant be open\n"; while(<FH>) { my @temp=split(/"/); if ($temp[1] eq 'stored-procedure') { print "$temp[3]\n"; } } close(FH);

But as always "There's more than one way to do it" n better also :)

Replies are listed 'Best First'.
Re^2: regex to match the following
by johngg (Canon) on May 08, 2007 at 10:52 UTC
    Sadly, the file does not have a uniform pattern. Several lines have the id="..." before the type="stored-procedure" so I think your method might fail.

    Cheers,

    JohnGG

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://614104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2020-02-19 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (81 votes). Check out past polls.

    Notices?