Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Well, 

If I'm reading your question right...you'd want to lock and 
pop open the file(s) and sift for something like:
[0-3]\{0,1}[0-9]/s[/April//Apr//August/...]/s[0-9]\{4\}/s([aAbB]\.\{0, +1}[cCdD]\.\{0,1})*
My regex isn't awesome...but that should look for chunks that
begin with zero to one instances of 0-3, followed by a 0-9,
followed by a space, followed by that list of months {which is
the one section I'm a lot fuzzy on.} then followed by a space
and four consecutive digits 0-9 and then followed entirely by 
that last chunk that looks for zero or more instances of A.D.,
AD, a.d., ad, B.C., BC, b.c., and bc.{Although I haven't tried
it, either...I'm trying freehand on it, but it's a start.}

_If_ I'm reading you right.

Then you'd take that matched bit and dump it to your opened
output file until you had no more input file to munge. Close
your files and unlock them and you'd be done.

If you knew what date formats to expect, you could fiddle 
with the regex a bit, ditching the ad/bc part if unnecessary
or shortening the month listing to either full months or the
abbreviated ones.

just my shot at it.

-brick.

In reply to Re: Date extraction by brick
in thread Date extraction by Perl-chick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found