How to read a CSV file and return query object in ColdFusion

Read a csv file and return query object using cfhttp

employee.csv


Emp_ID, FirstName, LastName
1, Jenny, Jones
2, Anne, Karina
3, Sonia, Suma






cfhttpCSV.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfhttp: how to read a csv file and return query object by cfhttp in coldfusion</title>
</head>

<body>
<h2 style="color:DeepPink; font-style:italic">cfhttp tag example: how to read .csv file data</h2>
<hr width="500" align="left" color="OrangeRed" />
<br />

<cfhttp 
 method="get"
    url="http://localhost:8500/cfexample/employee.csv" 
    name="EmployeeData"
    >
</cfhttp>

<cfdump var="#EmployeeData#" label="Employee List">

</body>
</html>





More ColdFusion examples