Simon Kr?ger schrieb:
> Paul D. Kraus schrieb:
>> Below is a quick attempt at doing some things in ruby that I have been
>> doing
>> in perl.
>> Question 1 how can I save and then reuse the functions that are defined in
>> other applicaitons.
>> Question 2 how can I rewrite some this in a more ruby way
>>
>> Itterating over an array and then having to have a counter variable to make
>> "in-place" changes seems a little overkill and I am pretty certian there is
>> probaly a better way.
>>
>> I have a lot of pipe delimented text files that I work with that contain
>> some standard thing that always get converted. Dates and Numbers to name a
>> few.
>>
>> Thanks for you time !! :)
>>
>> [...]
>
> this should do the same:
> [...]
sorry i missed that part:
if datearray[2].to_i > 90
datearray[2] = "19" + datearray[2]
else
datearray[2] = "20" + datearray[2]
end
well one should probably use Date#strptime anyway...
cheers
Simon