1 Reply Latest reply on Feb 6, 2008 12:09 PM by Dan Bracuk

    cfhttp - Need column names

    cfwild Level 1
      Hi,

      I'm pulling a .csv file using cfhttp. Getting the file is no problem. Is there an easy way to get to the names of the columns? Below is the cfdump: I'm trying to get to BRAND, PROD_DESCRIPTION, and UPC quickly. (I can use a loop and extract, just looking for something quicker if it exists). Like cfhttp.columnname?

      query
      BRAND PROD_DESCRIPTION UPC
      1 Kraft Kraft Macaroni & Cheese 6oz 55555-01001
      2 Kraft [empty string] 55555-01007
      3 Post Kraft Spirals & Cheese 7oz 55555-01002

      If there is an easy way to get to a particular address other than looping i.e. [column name][row number] I'd be interested in hearing those thoughts.

      Thanks!

      cfwild
        • 1. Re: cfhttp - Need column names
          Dan Bracuk Level 5
          Use the name attribute of cfhttp to create a query. Play around with the columns attribute. If you leave it out, the column headers of your file might become your columnlist.

          Details are in the cfml reference manual for cfhttp. If you don't have one, the internet does.