• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to query a csv file

Guest
Nov 07, 2013 Nov 07, 2013

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.

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Nov 07, 2013 Nov 07, 2013

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.

Votes

Translate

Translate
Advocate ,
Nov 07, 2013 Nov 07, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 08, 2013 Nov 08, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2013 Nov 08, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 08, 2013 Nov 08, 2013

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation