Skip navigation
l4zr
Currently Being Moderated

How to query a csv file

Nov 7, 2013 10:43 AM

Tags: #csv #cfquery #cffile

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.

 
Replies
  • Currently Being Moderated
    Nov 7, 2013 1:15 PM   in reply to l4zr

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2013 1:31 AM   in reply to l4zr

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points