Deane wondered:
> Still not sure how the double-post got doubled, though, nor why you
ended up with five copies. Ah, 'tis a mystery... One I've seen happen
before, to myself and others. Send one answer, everybody out there gets
two.
>From (one of the many of ;-) your post:
To: [EMAIL PROT
> Report any error while converting the string.
I thought this was an important part of the problem ... ;->
a
Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
VOICE: (608) 261-5738 FAX 264-5932
"CM/ECF is a complex unfinished suit. Pull on a loose cuff thread and
your pants fall down."
Almost... This works:
($date) = $data =~ m/^.+\|(\d+)/;
Then as below. It needs the '+'.
Deane Rothenmaier
Systems Architect
Walgreens Corp.
847-914-5150
"Science is not only compatible with spirituality; it is a profound source
of spirituality." -- Carl Sagan
"Matt Schneider" <[EMAIL PRO
Almost... This works:
($date) = $data =~ m/^.+\|(\d+)/;
Then as below. It needs the '+'.
Deane Rothenmaier
Systems Architect
Walgreens Corp.
847-914-5150
"Science is not only compatible with spirituality; it is a profound source
of spirituality." -- Carl Sagan
"Matt Schneider" <[EMAIL PRO
You could try something like this:
$data = '760434|c|061230';
($date) = $data =~ m/^.\|(\d+)/;
$date =~ s%(\d\d)(\d\d)(\d\d)%$2/$3/20$1%;
Matt
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
AITHA, BHEEMSEN (SBCSI)
Sent: Friday, January 05, 2007 11:57 AM
Thanks, it worked.
-Original Message-
From: $Bill Luebkert [mailto:[EMAIL PROTECTED]
Sent: Friday, January 05, 2007 11:32 AM
To: AITHA, BHEEMSEN (SBCSI)
Cc: perl-unix-users@listserv.ActiveState.com
Subject: Re: [Perl-unix-users] How to parse a date string and convert it
into mm/dd/ fo
AITHA, BHEEMSEN (SBCSI) wrote:
> Hi,
>
> I have a file with the following as the first line.
>
> 760434|c|061230
>
> I need to parse this line and read 061230 into a variable and then try
> to convert that string into the date in format mm/dd/. Report any
> error while converting the string.
while (<>) {
if ( not /\|/ ) {
warn "bad data line: $_";
next;
} # if no pipe
chomp;
my ($whoknows, $oneletter, $date_str ) = split(/\|/);
if ( not defined( $date_str ) ) {
warn "bad data line - no date string: $_";
next;
} # if no date
if ( len
Hi,
I have a file with the following as the first line.
760434|c|061230
I need to parse this line and read 061230 into a variable and then try
to convert that string into the date in format mm/dd/. Report any
error while converting the string.
Any sample code would be a great help.
I do no