Gossamer Forum
Home : Products : DBMan : Installation :

Get data from Data files

Quote Reply
Get data from Data files
I am going to make a database to store the file names of a number of news files which stored in text format.
Can I make use of the DB Man to store the information of filename, and show up the content after doing a search??

Thank you for your support!!

terewong
Quote Reply
Re: Get data from Data files In reply to
Yes,

Just display the filenames as links and you just have to click on them.

i.e.
<TR><TD ALIGN="Right" VALIGN="Center"><$font_color>Filename: </FONT></TD>
<TD> <$font><A HREF="file://$rec{'Filename'}">$rec{'Filename'}</A></Font></TD></TR>

Cheers
-JO
Quote Reply
Re: Get data from Data files In reply to
Another way to do it, although a little more complicated than Jaime's method, will allow you to have your text formatted in a nice page.

This is what I did. First I defined the full path (not URL!) to the directory where my text files are, called $text_file_path. Then I put a field in my db for the name of the text file associated with the record. (I didn't put the ".txt" extension in the database.) The following is the code that inserts the text file into the page:

if (open (FILE, qq|$text_file_path$rec{'file'}.txt|)) {
print <FILE>;
close FILE;
}
else { print "Can't find it"; }


You can put html formatting tags into your text file so it will look the way you want it to.

I hope this helps.


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


[This message has been edited by JPDeni (edited January 06, 1999).]