Blog

a great conversation starts with a great topic

This is a public Blog  publicRSS

  • 1-1 of 1
  • how to use columns attribute when read a csv file in...
    Entry posted 11/29/09 by FuseBox , tagged Development

    Employee1.csv

    1, Tayyab, Hussain
    2, Iftikhar , Iqbal
    3, Nadeem, Shah

    cfhttpColumns.cfm

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>cfhttp: how to use columns attribute when read a csv file in coldfusion</title>
    </head>

    <body>
    <h2 style="color:IndianRed; font-style:italic">cfhttp tag example: how to use columns attribute</h2>
    <hr width="500" align="left" color="IndianRed" />
    <br />

    <cfhttp
      method="get"
        url="http://localhost:8500/cfexample/employee1.csv"
        name="EmployeeData"
        columns="EmpID,FirstName,LastName"
        firstRowAsHeaders="no"
        >
    </cfhttp>

    <table border="1" cellpadding="5" cellspacing="0" bordercolor="IndianRed">
        <tr bgcolor="Crimson" style="color:White; font-weight:bold">
            <td>
                Employee ID
            </td>
            <td>
                First Name
            </td>
            <td>
                Last Name
            </td>
        </tr>
    <cfoutput query="EmployeeData">
         <tr bgcolor="Snow" style="color:IndianRed; font-weight:normal">
             <td>
                    #EmpID#
                </td>
             <td>
                    #FirstName#
                </td>
             <td>
                    #LastName#
                </td>
            </tr>
        </cfoutput>
    </table>

    </body>
    </html>

Recently Active

    No results

    Recent Comments

    No results

    Copyright © 2009 Adobe Systems Incorporated. All rights reserved.

    Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-08-2008).

    Powered by HiveLive