First of all, I'm not a fan of CSV files, as the comma is too common a delimiter. Best 
to export with some strange field delimiter (I often use "~~"), and ditto for end of 
line ("||||", for example)

Use CFFILE to open this file to a variable.

Two loops - outer to set each line (row) to a temp variable, the inner to treat the 
single line. 

On the inner loop, user the listGetAt function - with the given delimiter - to find 
the four elements you need:
    <cfset col1 = listGetAt(tempRow, 1, "~~")>
    <cfset col2 = listGetAt(tempRow, 2, "~~")>
    <cfset col3 = listGetAt(tempRow, 3, "~~")>
    <cfset col4 = listGetAt(tempRow, 4, "~~")>


So you end up with four lists, each the row's value for a given column

>Hey everyone,
>
> I have an excel file that has about 10 columns in it but I only need 4.
>I converted the excel file to a csv file but now am stuck on how to get
>only the columns I need. Is there a good solution for doing this?
>
> 
>
>Thanks,
>
>Ben
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138005
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to