Forum Moderators: coopster & phranque

Message Too Old, No Replies

Looking for a cgi script

Search script for my flatfile database

         

kingkelly

3:01 am on May 6, 2002 (gmt 0)

10+ Year Member



I already have a simple, flatfile databse that seperates all of the fields with ##. Each record is kept on a new line. I need a script that will search the text file, and then print out a nice table with record matches. Itssort of like an adress book. All the search scripts ive found need CSV database, or pipe delimited ones.

PLEASE HELP! This seems like an easy thing to do, but nobody has a script ofr it?!?

Any suggestions?
Thanks in advance!

john316

3:23 am on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you just do a find and replace on the ## ?

Air

4:03 am on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



....or

do the reverse and modify the search script to use ## instead of commas or pipes.

kingkelly

8:50 pm on May 6, 2002 (gmt 0)

10+ Year Member



Not so easy... Most CSV databases has the field names on the first line,ex:

name,email,phone
john,john@john.ca,555-3030
Bobo,1234@yahoo.ca,555-3582

MY database outputs stuff like:

john##john@john.ca##555-3030
Bobo##1234@yahoo.ca##555-3582

And also it has the first line end in ####, so that it can put the newest entries at the top of the table. Thats why it would be much less complicated if i just had a script to search a flatfile database, and then print the results in a table... See?

john316

9:16 pm on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you could try this...it allows you to select the delimiter.

[risearch.org...]

kingkelly

3:00 am on May 8, 2002 (gmt 0)

10+ Year Member



Heheh, i tried that one.. "RiLax - clone of script RiSearch, designed for plain text database indexing. "

You have to do some indexing garbage first be fore you can setup the search form... I never got the little index script to work... Paths are weird on my NT server... Would rather be on Unix :(

Thanks for the suggestion though!

Go Montreal Canadiens!