As others have already said, you can easily convert a CSV file into a query object using cfhttp
. Also, since you're using ColdFusion 11, you can convert a query object into json using serializeJson
with the struct
option. Then deserializeJson
to convert it back into an array of structs. All you need is 2 lines of code and your done.
See code example and link to TryCF gist below.
https://trycf.com/gist/b8f30141e8e6b588a396fb1051a38447/acf11?theme=monokai
<cfscript>
cfhttp(
name="myData",
url="https://raw.githubusercontent.com/sauravg94/test-repo/master/MOCK_DATA.csv",
firstrowasheaders="true",
method="GET"
);
myArrayOfStructs = deserializeJson(serializeJson(myData, "struct"));
writedump(myData);
writeDump(myArrayOfStructs);
</cfscript>
EDIT
Code updated due to Dan Bracuk's comment where he pointed out that I did not answer the question that was asked.