House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

CSV loop

Author:
Raymond Camden
01/29/2003 04:44 PM

So right now you have.. .... <cffile ...> <cfoutput>Hello</cfoutput> And you are saying the Hello doesn't show? And it's ABOVE the cfloop? ======================================================================= Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc Email    : jedimaster@mindseye.com WWW      : www.camdenfamily.com/morpheus Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > HOLY CANNOLI - CFDUMP on the file - zip, nada, nothin... I > put the word > HELLO on the page after the CFFILE, and it doesnt show - put > it up above, > and it does!  So it's not my query???? > > At 03:28 PM 1/29/03 -0600, you wrote: > >Ah - you should check and see if read_file is empty first - > before your > >cfloop, do a dump on that. Make sure you are actually > looping. Or you > >can also add debug statements in your cfloop tags.. > > > ><cfoutput>Going over a line, the line is #line#, enjoy<p></cfoutput> > > > >============================================================= > ========== > >Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc > > > >Email    : jedimaster@mindseye.com > >WWW      : www.camdenfamily.com/morpheus > >Yahoo IM : morpheus > > > >"My ally is the Force, and a powerful ally it is." - Yoda > > > > > Ray, > > > > > > Thanks so much for guiding me through all this - it's quite > > > frustrating... > > > > > > OK, so how do I implement it?  I tried the code below, > and again, it > > > comes up with a blank... > > > > > > <cfset delims=","> > > > <cfset numcols="3"> > > > <CFOUTPUT>#Delims#</CFOUTPUT> > > > <!--- read the file --> > > > <cffile > > >       action=read > > > > > > file="c:\inetpub\wwwroot\briona\secure\modernstorage\shop\cont > > > rol\QuantumModify.csv" > > >       variable="read_file"> > > > > > > <cfloop index="line" list="#read_file#" delimiters="#chr(13)#"> > > >     <!--- loop through the columns --> > > >     <cfloop from="1" to="#numcols#" index="num"> > > >        <cfquery name="update_file" datasource="ModernStorageECom"> > > >           UPDATE  Products > > >           SET > > >           JPG = '#listgetAt('#line#',2, ',')#"', > > >           PDF = '#listgetAt('#line#',3, ',')#"' > > >           where (MFGPartNumber = '#listgetAt('#line#',1, ',')#"') > > >        </cfquery> > > >     </cfloop> > > > </cfloop> > > > > > > <CFDUMP var="#update_file#"> > > > > > > > > > > > >


Search cf-talk

May 24, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference