Skip to main content
March 5, 2009
Question

How do I use a txt file as a database?

  • March 5, 2009
  • 2 replies
  • 789 views
Hello!
I am needing to do some basic queries on a text file, as a database... I *think* I know how to do it from the query side... but I had to set up an environment to get this done, and cannot figure out how to enable the text file as the data source. My understanding is that it would involve creating an ODBC connection, but I'm stumped at this point and could use some quick help!

Could you give me the play-by-play info I need to set this up and be able to do queries on it?

Thank you ALL!

This topic has been closed for replies.

2 replies

Inspiring
March 5, 2009
google "<cfhttp>".

The first offering should be the page from the cfml reference manual. Read the part about the name attribute. Then look at the example.
March 5, 2009
I've already done that... Having a hard time understanding it.

Let's say you have a text file with the following in it:

FName LName Phone City State
Bob Johnson 123-123-1234 Smalltown OH
Bill Edwards 123-123-4321 Bigcity NY
Kim Smith 312-123-1234 Nowhere IL

How would you, for example, select the cities from this 'table' in the text file? Or, if you've searched for "Bigcity" how would you display the other data from that record?

I'm sorry, but I'm needing that level of hand-holding with this one...


....And, if anybody knows anything about using the text files through ODBC, I need more of the help with the ODBC configuration and DSN assignment, than the queries...

At this point, any help will be huge!

Thanks!
Inspiring
March 5, 2009
cfhttp with a name attribute might be simpler.
March 5, 2009
Well... that would be awesome help if I knew anything about how to use that...
I'm under a sharp deadline, and although your suggestion probably is the answer (or *an* answer), I don't know how to use it at all... Any step-by-step help on how to do a query on a comma deliniated database file that is in txt format? ...I don't care what method, just need to know how to make something work... It's setup just like a database.. columns... etc. Help?

Thanks,
B