Gossamer Forum
Home : Products : DBMan : Customization :

Question on sorting by date

Quote Reply
Question on sorting by date
I have two databases I want to keep sorted by date. One in ascending order and one in descending order.

I've searched the dbman posts and found a lot of info on sorting by date. I didn't bookmark any particular post (I probably should have referenced one of them here) However, after reading many posts, I cannot tell if the sorting that is being done is the sorting of the actual database or the sorting of the output that is generated by dbman.

I need to keep the actual databases sorted because I have several external perl scripts that read from the dbman databases and they expect the data to already be sorted.

Can anyone refer me to a previous post that concerns the sorting of the database itself?
Quote Reply
Re: [acravens] Question on sorting by date In reply to
Is the date you are referring to a posting date? If so, then the database should be keeping the posted in order according to when they are posted ... but it will list each entry as it's posted to the end of the .db file.

I don't know of a way to actually sort the database file itself by a particular field.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Question on sorting by date In reply to
What would happen if I made a system call to sort the file after every modification?

sort events.db > events.db.sorted
mv events.db.sorted events.db
Quote Reply
Re: [acravens] Question on sorting by date In reply to
Problem solved... I'm sorting the db to a temp file and pointing the perl scripts to the temp file. No need to modify dbman or the perl script.