Gossamer Forum
Home : Products : DBMan : Customization :

How to define fields somewhere other than db.cfg

Quote Reply
How to define fields somewhere other than db.cfg
I'm trying to setup a database for a pool league. I am thinking of assigning each player a numerical ID and record their scores against others. The database would be something like:

PlayerID|Name|W-L_Against_001|W-L_Against_002|W-L_Against_003|W-L_Against_004
001|John Doe|3-2|8-4|1-3|0-0

Is there any way to define fields using the first line in the pipe delimited database file or perhaps a separate text file, rather than manually defining them in default.cfg? On a related note, how can I substitute the PlayerID field "001" to something like "John Doe" and "W-L_Against_001" to "John Doe (W-L)?

If you have answers to my questions, or have suggestions on setting up the database, please let me know! Thanks!

Quote Reply
Re: How to define fields somewhere other than db.cfg In reply to
In Reply To:
Is there any way to define fields using the first line in the pipe delimited database file or perhaps a separate text file, rather than manually defining them in default.cfg?
You could...by using the Perl "ignore" pound character (#} at the beginning of the first line, like the following:

Code:

#PlayerID|FieldName1|FieldName2


HOWEVER, you still have to define the fields in the %db_def hash in order for DBMAN to work properly.

Regards,

Eliot Lee