1-
my $number =~ s/^0*(\d+)/$1/

that should trim the leading 0's

2-
my $date =~ s#(\d{2})(\d{2})(\d{4})#$1/$2/$3#;

i use #'s as delimaters here... some other character may be more appropriate


At 07:49 AM 6/26/2003 -0700, Sara wrote:
I have a database with the following fields.

lname fnam M acct# mrm birth Postdate Post# drln drfn m disch
DOE,JOHN,R,00037839842,207337,02151956,04072003,01980,LastName,FirstName,L,04102003


I have a very simple script which splits the delimiter , and shows the result in the same format as in database.
I want to do following things using regex, but I have tried my options to my level best, ::) no results yet,


1- Remove all the leading 000 from any field like acct# = 00037839842 should be 37939842 and Post# should be 1980

2- Want to format dates like birth = 02151956 should be 02/15/1956

Any help??

Thanks,

Sara.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to