Perl script to extract last date field (yyyy/mm/dd)

Hi Friends,

I've a special requirement, even though I know how to implement this using shell scripting, current requirement is PERL, in which I'm not much familiar !!!.

I've a record, which has around 200 fields, out of which I need to extract only one date value from the 97th field (this field itself has many comma seperated values including date values). Below is one such an example record (observation need more attention to identify fields).

field1, field2,.....,field96,
("2008/12/17 2009/03/16 0.000000 0.000000 2009/03/16,
2009/03/16 2009/06/15 0.000000 0.000000 2009/03/18,
.......................,,
2009/03/16 2009/06/15 0.000000 0.000000 2009/03/18"),
field98,.....,field200

My requirement is to extract the second date field (marked with blue, underlined) from the last sub-field (this is also comma separated) of the field 97.

Any help would be much appreciated on this challenging task!!!

Thanks in advance / Mysore Ganapati.

The most obvious way would be to use 'split' to break the record into an array of fields. Syntax for split is

where EXPR will be your entire record and PATTERN is a regular expression that defines how to split the record. LIMIT (if present) is (simplicticly) the maximum number of times to split the line up.
But it's not clear, to me at least, where your field separators are. Are they white space or commas?

Are the brackets relevant? Are they the only ones in the line in which case you could match "(.*)" to extract your 97th element.

Once you have the 97th element, split it again.

Hope that helps, but not sure it will!:confused:

Jerry