Gossamer Forum
Home : Products : DBMan : Customization :

Formating and delimiters

Quote Reply
Formating and delimiters
My first post....:)
I just started using DBman and I've got the basics of it configured to what I'm after. I'm a novice at Perl, but I'm learning. My problem is this.

I've visited a ton of Perl resource sites and all the sites associated with DBman (jpdeni's sight rocks and the unofficial faq's did too.)
I'm using a very simple copy and paste into a single large text field, Like this:

text text
text
text: 50022
text1: text
text2: text
text3: text
text4: 27 text: 202285
text5: 177324
text6: 403947
text7: 38261
text8: 1903685
text9 text: 742 text: 12624

(I've removed the actual info for privacy)
This info is copied right from a webpage and looks just like the above when I paste into my text area for submission to the DBman. I looked in my default.db file and the delimiter is a "``" character. I believe that's a TAB character?
Should I change my delimiter to the same character to manipulate the info easier? Or should the text be converted to a CSV format? If so How?

I plan on formatting the info into a table. I need to know how to do this with the info above?
And I don't know how to split the following into two separate fields (or perhaps lines if I can keep the TAB character as a delimiter)

text4: 27 text: 202285

I just wanna paste the info as it is and format each field into a table. I know html really well. Perl...........?

Any help would be appreciated.

Virg

Quote Reply
Re: Formating and delimiters In reply to
The default dbman delimiter is the pipe (|).
If you are going to grab data as a text file, then you must first change the delimiter within the text file to a pipe.
One way of doing this is to "Open" the file in Excel. Using the wizard it will allow you to specify the existing delimiter so that the fields are converted into columns.
If you then save the file as a CSV file (with comma separators) you can then open it in, say, EditPlus, and do a global replace, replacing commas with pipes.
You must be careful when you do all this. If there are null fields at the end of any line in Excel, you will get bad results. To overcome this, make a new right hand column in Excel, and fill each cell with a word that is unlikely to appear in the db - 'wibble' is a good one! This will enable you to remove it from the db file with a global replace, and you will have the correct number of fields and delimiters.

David Olley
Anglo & Foreign International Limited,
http://www.afil.co.uk
Quote Reply
Re: Formating and delimiters In reply to
Hehehe... I, too, have used the "wibble method." Which will now, in my opinion, be the offical title of that process. :)

Quote Reply
Re: Formating and delimiters In reply to
I should have added that when removing the "wibble" from the db file you must remove the preceding pipe separator with it.

David Olley
Anglo & Foreign International Limited,
http://www.afil.co.uk