Column sort (Noobie question)

I am write a program to sort pictures, I can read in the directory and
rename the picture basied on the exif information but I now want to do
load the directory and exif timestamp into a two column table and then
sort. I have searched for a multi column array or table but have not
found an example. Any suggestions?

Thanks,

-Pablo

On 9/4/06, Pablo T. [email protected] wrote:

I am write a program to sort pictures, I can read in the directory and
rename the picture basied on the exif information but I now want to do
load the directory and exif timestamp into a two column table and then
sort. I have searched for a multi column array or table but have not
found an example. Any suggestions?

You could probably use an array of arrays, and the sort_by method.
This sorts a two-column table by name:

table = [[‘name03’,], [‘name02’,],
[‘name01’,]]

table.sort_by { |element| element[0] }

The above example is not “real” Ruby code because of the “”
thingies, but it should work if you use it with your real data.