Here is the code for those that have asked for it. permissions on the 
folder are all good.

<cfdirectory action="list" name="getfiles" 
directory="e:\renamedatafile\" filter="*.csv">
<cfloop query="getfiles">
  <cfoutput>---#Name#---<br />
  </cfoutput>
 
  <cfscript>
 fileReader = CreateObject("java", "java.io.FileReader");
 fileReader.init("e:\\renamedatafile\\#name#");
 br = CreateObject("java", "java.io.BufferedReader");
 br.init(fileReader);
</cfscript>

  <cftry>
    <cfloop condition="true">
     
        <cfscript>
            line = br.readLine();
        </cfscript>
     
      <cfoutput>
         <cfif imagename neq "Thumbs.db">
          <cfquery datasource="imagevault">
            UPDATE photo SET photostatusid = 2, digloc = 19, photoname = 
'#listgetat(line,2)#' WHERE imagenum =#imagename#
          </cfquery>
        </cfif>
      </cfoutput>
  
    </cfloop>
  
    <cfcatch type="coldfusion.runtime.UndefinedVariableException">
      <!--- this indicates end of file, ok to ignore error --->
    </cfcatch>
   
  </cftry>


  <cffile action="move" source="e:\renamedatafile\#name#" 
destination="e:\renamedatafile\done\#name#"  nameconflict="overwrite" >
 </cfloop>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238870
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to