Copy link to clipboard
Copied
Hello I am new to cold fusion.
I am wondering if there is a way to query a csv file using a read from cffile? Currently I have it setup as a cffile read and then I try to query the file using cffquery. Obviously this doesn't work because I have to set a datasource. Is there anyway to do this or any way to set a csv file as a data source? Any help or direction would be greatly appreciated.
Thanks.
You would have to read in the csv and create a query using QueryNew(). Once you have the csv in a query format, then you can perform query of queries to do most anything you want on the data. There is probably code already written out there to do the csv to query, you just need to find it. The query of queries is in the documentation. The only gotcha is that query of queries sorting and matching is case sensitive. Hope this helps.
Copy link to clipboard
Copied
You would have to read in the csv and create a query using QueryNew(). Once you have the csv in a query format, then you can perform query of queries to do most anything you want on the data. There is probably code already written out there to do the csv to query, you just need to find it. The query of queries is in the documentation. The only gotcha is that query of queries sorting and matching is case sensitive. Hope this helps.
Copy link to clipboard
Copied
I really appreciate your advice and reply. This was the easiest way for me to get this done. Thanks for keeping it simple and sending me in the right direction.
Copy link to clipboard
Copied
This article shows how to query a CSV file: http://www.coldfusionmuse.com/index.cfm/2007/2/5/csv
Also make sure and read all the comments beneath it
Copy link to clipboard
Copied
Hey thanks for the help I actually saw this article before I posted here. The datasource stuff was a little over my head and I was in a time crunch to get it done. I didnt have time to rerch all the extra stuff.
Thanks again.