Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Can anyone help with reading CSV file in COldFusion?

$
0
0

Hello everyone, I'm trying to read CSV file and output with ColdFusion. I store all records in array and I have to pull out just first and last column with all records. My current code gives me just a row with all columns. Can anyone help with this please? Here is my code:

 

<cffile action="read" file="#ExpandPath('Status.csv')#" variable="myfile">

<cfset myarray = ListToArray(myfile,chr(13))>

<cfset cnt = ArrayLen(myarray)>

 

 

<cfloop index="index" array="#myarray#">

<cfoutput>

  #index#

  <br/>

</cfoutput>

</cfloop>


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>