If you're willing to use PHP CLI, this works on 32-bit systems, because
we're not invoking the date function:

<?php
$input_file  = '';
$output_file = '';

$input  = file($input_file);
$output = fopen($outpu_file, 'w');

foreach ($input as $line) {
    list($month, $day, $year) = explode('/', $line);
    if ($month < 10) $month = '0'.$month;
    $new_date = $year.'/'.$month.'/'.$day;
    fwrite($output, $new_date);
}
?>

I'm sure something similar can be done with bash, but I don't know bash.

On Wed, Jul 16, 2008 at 11:27 AM, Abdallah <[EMAIL PROTECTED]> wrote:

>
> Output
>
> --8/31/2011
> --1/7/2088
> --1/31/2013
> --11/4/2010
>
> Must be:
>
> 2011/08/31
> 2088/01/07
> 2013/01/31
> 2010/11/04
>
> :)
>
> Abdallah
>
>
>
> On Wed, Jul 16, 2008 at 4:12 AM, sci3ntist <[EMAIL PROTECTED]>
> wrote:
> >
> > #!/bin/sh
> > IFS='-'
> > while read y m d; do
> >  echo "$m-$d-$y" >> sumtxt.txt
> > done < datefile.txt
> >
> > >
> >
>
> >
>


-- 
Al-Faisal El-Dajani
Phone: +962-7-79737050
P.O Box: 140056
11814 Amman, Jordan

--~--~---------~--~----~------------~-------~--~----~
### Jordan Linux Users Group ###
http://Jolug.org/
http://groups.google.com/group/Jolug

### Ubuntu Jordan LoCo Team ###
https://wiki.ubuntu.com/JordanTeam
http://lists.ubuntu.com/ubuntu-jo

### Ojuba Linux ### 
http://ojuba.org/

### Jordan PHP ###
http://groups.google.com/group/JoPHP
-~----------~----~----~----~------~----~------~--~---

رد على