Gossamer Forum
Home : Products : DBMan : Customization :

Leading Delimiter Problem

Quote Reply
Leading Delimiter Problem
Hi All,

Hope this is a simple one. I am trying to view a flat file database with DBMan that was created by another CGI Script (BFormMail). The problem I am having is that there is a leading pipe (|) delimiter in front of each record. Is there a way DBMan can handle this? Any thoughts?

P.S. Seems I also have a trailing delimiter as well.


------------------
RJ

[This message has been edited by RJ (edited August 07, 1999).]
Quote Reply
Re: Leading Delimiter Problem In reply to
The typical format of .db files in DBMAN is the following:

1|Field1|Field2|Field3|Field4

What you could try is using a conversion program such as Object Access that will take out that first delimiter. Just a suggestion.

To answer your question, DBMAN will not be able to properly read the following format:

|1|Field1|Field2|Field3|Field4

May be others have ideas about converting your other flat file into a format that DBMAN can read.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Leading Delimiter Problem In reply to
Back again with another idea.

The following Code is from (BFormMail) a CGI Script that Produces a Database file, I am trying to view with DBMan, but it creates a DB file with delimiters on both ends. My thoughts are, If I can alter the code to produce a flat file DB without delimiters on both ends of each record I'm home free. Can anyone help me alter the code?
=========================

open (DATABASE, ">>$Config{'append_db'}");
print DATABASE "$Config{'db_delimiter'}";
print DATABASE "$date2$Config{'db_delimiter'}";
print DATABASE "$time$Config{'db_delimiter'}";

foreach $print_db (@Print_DB) {
if ($Config{$print_db}) {
$field = $Config{$print_db};
$field =~ s/\r\n/ /gs;
print DATABASE "$field";
}
if ($Form{$print_db}) {
$field = $Form{$print_db};
$field =~ s/\r\n/ /gs;
print DATABASE "$field";
};

print DATABASE "$Config{'db_delimiter'}";

};

print DATABASE "\n";
close (DATABASE);
=====================================
Quote Reply
Re: Leading Delimiter Problem In reply to
I had another thought that's kinda sneaky. You could just create a dummy field at the beginning and end of your database which would not be required. ("Not null" = 0). You wouldn't need to create input fields for these db fields either, since they would have no data in them.

Then you wouldn't have to mess with any code at all.


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





Quote Reply
Re: Leading Delimiter Problem In reply to
Good Idea,

After a good nights sleep, I came up with the same idea. I will only be using DBMan to view the data, the two dummy fields, won't hurt anything, but they will keep the data in the right row. I'll try it out right now and see if it works but have no doubt it will. Thanks!!!

------------------
RJ