Gossamer Forum
Home : Products : DBMan : Installation :

Adding a new field

Quote Reply
Adding a new field
Hi,

I have added about 500 records so far to my database. I have 10 fields which I set in the .cfg file. Now I realize that I need a couple more fields to the database. If I add these fields to the .cfg file now, and continue to add records, the first 500 will not have these fields.

Please tell me how I can do this. I think I have seen this question somewhere, but I can't quite find it.

------------------
JFrost





Quote Reply
Re: Adding a new field In reply to
You'll need to add delimiters to the old records for the new fields.

Be sure to add the new fields at the end of your field list in the .cfg file. Don't insert them in the middle of the list.

Then download your .db file and load it into a good text editor (I use Programmer's File Editor, avaliable for free at download.com) Whatever you do, don't use a word processor!

A lot of text editors (including PFE) will allow you to do a "search and replace" on the linefeeds. The one you use might have a different syntax, but a common one is

search for \n
replace with |\n

Add as many | characters (pipe characters) as the number of fields you are adding. Then save the file and upload it back onto your server. (If there's a chance that anyone added a record while you were working, I'd check for that first.)

I'm sure I don't need to say this, but be sure you upload the file in ASCII mode.


------------------
JPD