Link to home
Create AccountLog in
Avatar of armanbena
armanbena

asked on

Better way to read multiple files and complete string replacement

Hi,

I am working with a coldfusion Component. Based on verbiage in a textbox, I will do a r
eplacement of contents stored in that file with that text.
It is working. However, as I try to add additional files that may need to be read, it stops all together. I think I have hit a max in the number of files I can read at the server. At this point, it is not necessary that all the files be read, just the ones that need replacing. Attached is my code. That should make more sense. Any ideas.
<cfcomponent>
    <cffunction name="createEditorFile" access="remote" returnType="string">
        <cfargument name="data" type="string" required="true">
        <cfargument name="GroupNo" type="string" required="no">
        <cfargument name="NPSGroupNumber" type="string" required="no">
        <cfargument name="NPSGroupSection" type="string" required="no">
        <cfargument name="BPIDReg" type="string" required="no">
      
      <cfset cleanData = replace(#arguments.data#,"<>","","all")>
      <cfset cleanData = replace(#cleandata#,"</>","","all")>
      <cfset cleanData = replace(#cleandata#,"<tbody>","","all")>
      <cfset cleanData = replace(#cleandata#,"</tbody>","","all")>
      <cfset cleanData = replace(#cleandata#,"</tbody>","","all")>
      <cfset cleanData = replace(#cleandata#,"</ />","","all")>
      <cfset cleanData = replace(#cleandata#,"<strong>","<b>","all")>
      <cfset cleanData = replace(#cleandata#,"</strong>","</b>","all")>
      <cfset cleanData = replace(#cleandata#,"&lt;","","all")>
      <cfset cleanData = replace(#cleandata#,"</table />","","all")>
     <cfset cleanData = replace(cleandata,'<th class="col1" />','<th class="col1">&nbsp;</th>',"all")>
  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\BVO\BVO_HCR.html" 
    variable="datafile"/>
    
      <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\CMM\CMM_HCR.html" 
    variable="datafile1"/>
     
           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\POS\BlueChoice_PPO_HCR.html" 
    variable="datafile2"/>
   
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\CMMPPO\CMM-PPO_HCR.html" 
    variable="datafile3"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\FLEX_BLUE\FB_HCR.html" 
    variable="datafile4"/>
     
    <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\TRAD\FD_MM_HCR.html" 
    variable="datafile5"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\TRAD\FD_HCR.html" 
    variable="datafile6"/>
  

        
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\TRAD\FD_PLUS_MM.html" 
    variable="datafile7"/>


    
      
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\PPO\CB_HCR.html" 
    variable="datafile8"/>
    
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SB\SB_HRA_HCR.html" 
    variable="datafile9"/>
    
    
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SB\SB_HCR.html" 
    variable="datafile10"/>
    
    
        
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\3_COL.html" 
    variable="datafile11"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\5_COL.html" 
    variable="datafile12"/>
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\6_COL.html" 
    variable="datafile13"/>
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\Blue_Advantage_Rx.html" 
    variable="datafile14"/>
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\Dental\BDC.html" 
    variable="datafile15"/>
    
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\Dental\CD3.html" 
    variable="datafile16"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\Dental\ED1.html" 
    variable="datafile17"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\Dental\Trad_Plus_DC.html" 
    variable="datafile18"/>
    
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\VISION\A80_Vision.htm" 
    variable="datafile19"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\VISION\Blue_Vision.html" 
    variable="datafile20"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\VISION\Blue_Vision_VSP.html" 
    variable="datafile21"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\VISION\Vision_Exam_Only.html" 
    variable="datafile22"/>
    
           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\HEARING\HC.html" 
    variable="datafile23"/>
	
    
  
               <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\2_1_HCR.html" 
    variable="datafile24"/>
    
                  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\2_1_GRAND.html" 
    variable="datafile25"/>


             <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Supplemental Coverage (2 + 1) MM65 HCR.html" 
    variable="datafile26"/>
    
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Supplemental Coverage (2 + 1) MM65 GRAND.html" 
    variable="datafile27"/>
    
    
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Exact Fill CMM - HCR.html" 
    variable="datafile28"/>
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Exact Fill - HCR.html" 
    variable="datafile29"/>
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Med-E-Fill.html" 
    variable="datafile30"/>

  <!------>
    <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\BVO\PHCS_BVO_HCR.html" 
    variable="datafile31"/>

      <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\CMM\PHCS_CMM_HCR.html" 
    variable="datafile32"/>
    
    
          <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\CMMPPO\PHCS_CMM-PPO_HCR.html" 
    variable="datafile33"/>
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\FLEX_BLUE\PHCS_FB_HCR.html" 
    variable="datafile34"/>
     

  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\POS\PHCS_BCP_HCR.html" 
    variable="datafile35"/>
    
    
      <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\PPO\PHCS_CB_HCR.html" 
    variable="datafile36"/>

        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SB\PHCS_SB_HRA_HCR.html" 
    variable="datafile37"/>
    
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SB\PHCS_SB_HCR.html" 
    variable="datafile38"/>
    
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\WPHCS_3_COL.html" 
    variable="datafile39"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\WPHCS_5_COL.html" 
    variable="datafile40"/>
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\WPHCS_6_COL.html" 
    variable="datafile41"/>
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\Mandated_Prescription_Rx.html" 
    variable="datafile42"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\RX\PHCS_Blue_Advantage_Rx.html" 
    variable="datafile43"/>
    
                   <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\PHCS_2_1_HCR.html" 
    variable="datafile44"/>
    
                       <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\PHCS_Med-E-Fill.html" 
    variable="datafile45"/>
    
     <!--- 
                           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\FLEX-BLUE\PHCS_FB_HCRC20.html" 
    variable="datafile46"/>
  
    
                           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\POS\PHCS_CB_HCRC20.html" 
    variable="datafile47"/>
    
    
                           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\PPO\PHCS_BlueChoice_PPO_HCRC20_50.html" 
    variable="datafile48"/>--->

<cfset cleanData = replace(cleandata,'Blue Value Option - PPO', datafile, "all")> 

<cfset cleanData = replace(cleandata,'Blue Managed Traditional: (CMM)',datafile1,"all")>


<cfset cleanData = replace(cleandata,'Blue Choice PPO',datafile2,"all")>


<cfset cleanData = replace(cleandata,'Comprehensive Major Medical (CMM)',datafile3,"all")>


<cfset cleanData = replace(cleandata,'Flexible Blue',datafile4,"all")>


<cfset cleanData = replace(cleandata,'Blue Managed Traditional and MM',datafile5,"all")>


<cfset cleanData = replace(cleandata,'Blue Managed Traditional',datafile6,"all")>


<cfset cleanData = replace(cleandata,'Blue Managed Traditional Plus',datafile7,"all")>


<cfset cleanData = replace(cleandata,'Community Blue',datafile8,"all")>



<cfset cleanData = replace(cleandata,'Simply Blue - HRA', datafile9 ,"all")>


<cfset cleanData = replace(cleandata,'Simply Blue',datafile10,"all")>


<cfset cleanData = replace(cleandata,'3 Column Rx',datafile11,"all")>
<cfset cleanData = replace(cleandata,'5 Column Rx',datafile12,"all")>
<cfset cleanData = replace(cleandata,'6 Column Rx',datafile13,"all")>
<cfset cleanData = replace(cleandata,'Blue Advantage',datafile14,"all")>


<cfset cleanData = replace(cleandata,'Blue Dental Choice File',datafile15,"all")>
<cfset cleanData = replace(cleandata,'Community Dental File',datafile16,"all")>
<cfset cleanData = replace(cleandata,'Exclusive Dental File',datafile17,"all")>
<cfset cleanData = replace(cleandata,'Traditional Plus Dental File',datafile18,"all")>



<cfset cleanData = replace(cleandata,'Vision Care (A80) File',datafile19,"all")>
<cfset cleanData = replace(cleandata,'Blue Vision Coverage File',datafile20,"all")>
<cfset cleanData = replace(cleandata,'Blue Vision Coverage - VSP File',datafile21,"all")>
<cfset cleanData = replace(cleandata,'Blue Vision - Exam Only File',datafile22,"all")>

<cfset cleanData = replace(cleandata,'Hearing Care File',datafile23,"all")>


  <cfset cleanData = replace(cleandata,'2_1_HCR File',datafile24,"all")>
    <cfset cleanData = replace(cleandata,'2_1_GRAND File',datafile25,"all")>
    
    
  <cfset cleanData = replace(cleandata,'Supplemental Coverage (2 + 1) MM65 HCR File',datafile26,"all")>
    <cfset cleanData = replace(cleandata,'Supplemental Coverage (2 + 1) MM65 GRAND File',datafile27,"all")>
  
  <cfset cleanData = replace(cleandata,'Exact Fill CMM - HCR File',datafile28,"all")>
  <cfset cleanData = replace(cleandata,'Exact Fill - HCR File',datafile29,"all")>
  <cfset cleanData = replace(cleandata,'Med-E-Fill File',datafile30,"all")>
  
  
  <!------>
  
		<cfset cleanData = replace(cleandata,'PHCS1MED',datafile31,"all")> <!--- NEW Blue Value Option - PPO--->
        <cfset cleanData = replace(cleandata,'PHCS2',datafile32,"all")><!--- NEW_Blue Managed Traditional: (CMM)--->
        <cfset cleanData = replace(cleandata,'PHCS3',datafile33,"all")><!---NEW_Comprehensive Major Medical (CMM) --->
        <cfset cleanData = replace(cleandata,'PHCS4',datafile34,"all")><!---NEW_Flexible Blue --->
        <cfset cleanData = replace(cleandata,'PHCS5',datafile35,"all")><!---NEW_Blue Choice PPO --->
        <cfset cleanData = replace(cleandata,'PHCS6',datafile36,"all")><!---NEW_Community Blue --->
        <cfset cleanData = replace(cleandata,'PHCS7',datafile37,"all")><!---NEW_Simply Blue - HRA --->
        <cfset cleanData = replace(cleandata,'PHCS8',datafile38,"all")><!---NEW_Simply Blue --->
        <cfset cleanData = replace(cleandata,'PHCSRX1',datafile39,"all")><!---NEW_3 Column Rx --->
        <cfset cleanData = replace(cleandata,'PHCSRX2',datafile40,"all")><!--- NEW_5 Column Rx--->
        <cfset cleanData = replace(cleandata,'PHCSRX3',datafile41,"all")><!--- NEW_6 Column Rx--->
        <cfset cleanData = replace(cleandata, 'PHCSRX4',datafile42,"all")><!--- NEW_Mandated Prescription--->
        <cfset cleanData = replace(cleandata,'PHCSRX5',datafile43,"all")><!--- NEW_Blue Advantage--->
        <cfset cleanData = replace(cleandata,'PHCSPLAN',datafile44,"all")><!---NEW 2_1_HCR --->
        <cfset cleanData = replace(cleandata,'PHCSPLAN2',datafile45,"all")><!---NEW Med-E-Fill --->
      <!---  <cfset cleanData = replace(cleandata,'PHCSPLAN3',datafile46,"all")>NEWFB C20 --->
        
       <!---    <cfset cleanData = replace(cleandata,'PHCSPLAN3',datafile46,"all")><!---NEW Med-E-Fill --->
         
           <cfset cleanData = replace(cleandata,'PHCSPLAN4',datafile7,"all")><!---NEW Med-E-Fill --->
          
           <cfset cleanData = replace(cleandata,'PHCSPLAN5',datafile48,"all")><!---NEW Med-E-Fill --->--->
	
<!---  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\BVO\BVO_HCR.html" 
    variable="datafile"/>
    
      <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\CMM\CMM_HCR.html" 
    variable="datafile1"/>
     
           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\POS\BlueChoice_PPO_HCRC0_30.html" 
    variable="datafile2"/>
    
              <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\POS\BlueChoice_PPO_HCRC20_50.html" 
    variable="datafile3"/>
    
    
    
    
   
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\CMMPPO\CMM-PPO_HCR.html" 
    variable="datafile4"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\FLEX_BLUE\FB_HCRC0.html" 
    variable="datafile5"/>
     
             <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\FLEX_BLUE\FB_HCRC20.html" 
    variable="datafile6"/>
     
     
     
    <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\TRAD\FD_MM_HCR.html" 
    variable="datafile7"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\TRAD\FD_HCR.html" 
    variable="datafile8"/>
  

   
      
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\PPO\CB_HCR.html" 
    variable="datafile9"/>
    
          <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\PPO\CB_HCRC20.html" 
    variable="datafile10"/>
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SB\SB_HRA_HCR.html" 
    variable="datafile11"/>
    
    
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SB\SB_HCR.html" 
    variable="datafile12"/>
    
    
        
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\3_COL.html" 
    variable="datafile13"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\5_COL.html" 
    variable="datafile14"/>
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\6_COL.html" 
    variable="datafile15"/>
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\Blue_Advantage_Rx.html" 
    variable="datafile16"/>
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\Mandated_Prescription_Rx.html" 
    variable="datafile17"/>
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\Dental\BDC.html" 
    variable="datafile18"/>
    
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\Dental\CD3.html" 
    variable="datafile19"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\Dental\ED1.html" 
    variable="datafile20"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\Dental\Trad_Plus_DC.html" 
    variable="datafile21"/>
    
    
    
          <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\Dental\BlueDentalEPOVoluntaryOON.html" 
    variable="datafile22"/>
    
    
    
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\VISION\A80_Vision.htm" 
    variable="datafile23"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\VISION\Blue_Vision.html" 
    variable="datafile24"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\VISION\Blue_Vision_VSP.html" 
    variable="datafile25"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\VISION\Vision_Exam_Only.html" 
    variable="datafile26"/>
    
           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\HEARING\HC.html" 
    variable="datafile27"/>
	
    
  
               <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\2_1_HCR.html" 
    variable="datafile28"/>
    
                  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\2_1_GRAND.html" 
    variable="datafile29"/>


             <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Supplemental Coverage (2 + 1) MM65 HCR.html" 
    variable="datafile30"/>
    
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Supplemental Coverage (2 + 1) MM65 GRAND.html" 
    variable="datafile31"/>
    
    
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Exact Fill CMM - HCR.html" 
    variable="datafile32"/>
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Exact Fill - HCR.html" 
    variable="datafile33"/>
    
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\Med-E-Fill.html" 
    variable="datafile34"/>

  <!------>
    <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\BVO\PHCS_BVO_HCR.html" 
    variable="datafile35"/>

      <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\CMM\PHCS_CMM_HCR.html" 
    variable="datafile36"/>
    
    
          <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\CMMPPO\PHCS_CMM-PPO_HCR.html" 
    variable="datafile37"/>
    
    
    
    
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\FLEX_BLUE\PHCS_FB_HCR.html" 
    variable="datafile38"/>
     
     
     
                 <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\FLEX_BLUE\PHCS_FB_HCRC20.html" 
    variable="datafile39"/>
    
    
    
    

  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\POS\PHCS_BlueChoice_PPO_HCRC0_30.html" 
    variable="datafile40"/>
    
    
  <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\POS\PHCS_BlueChoice_PPO_HCRC20_50.html" 
    variable="datafile41"/>
    
    
    
      <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\PPO\PHCS_CB_HCR.html" 
    variable="datafile42"/>
    
    
          <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\PPO\PHCS_CB_HCRC20.html" 
    variable="datafile43"/>
  
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\TRAD\PHCS_FD_HCR.html" 
    variable="datafile44"/>
    
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\TRAD\PHCS_FD_MM_HCR.html" 
    variable="datafile45"/>
    
    
    
    

        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SB\PHCS_SB_HRA_HCR.html" 
    variable="datafile46"/>
    
          
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SB\PHCS_SB_HCR.html" 
    variable="datafile47"/>
    
    
            <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\WPHCS_3_COL.html" 
    variable="datafile48"/>
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\WPHCS_5_COL.html" 
    variable="datafile49"/>
    
    
        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\WPHCS_6_COL.html" 
    variable="datafile50"/>
    

        <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\RX\PHCS_Blue_Advantage_Rx.html" 
    variable="datafile51"/>
    
                   <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\PHCS_2_1_HCR.html" 
    variable="datafile52"/>
    
    
    
           <cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency_Testing\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\PHCS_2_1_HCR.html" 
    variable="datafile53"/>
    
    

<cfset cleanData = replace(cleandata,'Blue Value Option - PPO', datafile, "all")> 

<cfset cleanData = replace(cleandata,'Blue Managed Traditional: (CMM)',datafile1,"all")>


<cfset cleanData = replace(cleandata,'Blue Choice PPO C0',datafile2,"all")>



<cfset cleanData = replace(cleandata,'Blue Choice PPO C20',datafile3,"all")>


<cfset cleanData = replace(cleandata,'Comprehensive Major Medical (CMM)',datafile4,"all")>


<cfset cleanData = replace(cleandata,'Flexible Blue C0',datafile5,"all")>


<cfset cleanData = replace(cleandata,'Flexible Blue C20',datafile6,"all")>


<cfset cleanData = replace(cleandata,'Blue Managed Traditional and MM',datafile7,"all")>


<cfset cleanData = replace(cleandata,'Blue Managed Traditional',datafile8,"all")>


<!---<cfset cleanData = replace(cleandata,'Blue Managed Traditional Plus',datafile9,"all")>--->


<cfset cleanData = replace(cleandata,'Community Blue C0',datafile9,"all")>

<cfset cleanData = replace(cleandata,'Community Blue C20',datafile10,"all")>


<cfset cleanData = replace(cleandata,'Simply Blue - HRA', datafile11 ,"all")>


<cfset cleanData = replace(cleandata,'Simply Blue',datafile12,"all")>


<cfset cleanData = replace(cleandata,'3 Column Rx',datafile13,"all")>
<cfset cleanData = replace(cleandata,'5 Column Rx',datafile14,"all")>
<cfset cleanData = replace(cleandata,'6 Column Rx',datafile15,"all")>
<cfset cleanData = replace(cleandata,'Blue Advantage',datafile16,"all")>

<cfset cleanData = replace(cleandata,'Mandated Rx',datafile17,"all")>


<cfset cleanData = replace(cleandata,'Blue Dental Choice File',datafile18,"all")>
<cfset cleanData = replace(cleandata,'Community Dental File',datafile19,"all")>
<cfset cleanData = replace(cleandata,'Exclusive Dental File',datafile20,"all")>
<cfset cleanData = replace(cleandata,'Traditional Plus Dental File',datafile21,"all")>

<cfset cleanData = replace(cleandata,'BlueDental EPO Voluntary',datafile22,"all")>

<cfset cleanData = replace(cleandata,'Vision Care (A80) File',datafile23,"all")>
<cfset cleanData = replace(cleandata,'Blue Vision Coverage File',datafile24,"all")>
<cfset cleanData = replace(cleandata,'Blue Vision Coverage - VSP File',datafile25,"all")>
<cfset cleanData = replace(cleandata,'Blue Vision - Exam Only File',datafile26,"all")>

<cfset cleanData = replace(cleandata,'Hearing Care File',datafile27,"all")>


  <cfset cleanData = replace(cleandata,'2_1_HCR File',datafile28,"all")>
    <cfset cleanData = replace(cleandata,'2_1_GRAND File',datafile29,"all")>
    
    
  <cfset cleanData = replace(cleandata,'Supplemental Coverage (2 + 1) MM65 HCR File',datafile30,"all")>
    <cfset cleanData = replace(cleandata,'Supplemental Coverage (2 + 1) MM65 GRAND File',datafile31,"all")>
  
  <cfset cleanData = replace(cleandata,'Exact Fill CMM - HCR File',datafile32,"all")>
  <cfset cleanData = replace(cleandata,'Exact Fill - HCR File',datafile33,"all")>
  <cfset cleanData = replace(cleandata,'Med-E-Fill File',datafile34,"all")>
  
  
  <!------>
  
		<cfset cleanData = replace(cleandata,'PHCS1MED',datafile35,"all")> <!--- NEW Blue Value Option - PPO--->
        
        
        <cfset cleanData = replace(cleandata,'PHCS2',datafile36,"all")><!--- NEW_Blue Managed Traditional: (CMM)--->
        
        
        <cfset cleanData = replace(cleandata,'PHCS3',datafile37,"all")><!---NEW_Comprehensive Major Medical (CMM) --->
        
        
        <cfset cleanData = replace(cleandata,'PHCS4',datafile38,"all")><!---NEW_Flexible Blue c0 --->
        <cfset cleanData = replace(cleandata,'PHCS5',datafile39,"all")><!---NEW_Flexible Blue c20 --->
        
        <cfset cleanData = replace(cleandata,'PHCS6',datafile40,"all")><!---NEW_Blue Choice PPO c0 --->
        <cfset cleanData = replace(cleandata,'PHCS7',datafile41,"all")><!---NEW_Blue Choice PPO c20 --->
        
        
        <cfset cleanData = replace(cleandata,'PHCS8',datafile42,"all")><!---NEW_Community Blue c0 --->
         <cfset cleanData = replace(cleandata,'PHCS9',datafile43,"all")><!---NEW_Community Blue c20 --->
         
         
                 
        <cfset cleanData = replace(cleandata,'PHCS10',datafile44,"all")><!---NEW_TRAD --->
         <cfset cleanData = replace(cleandata,'PHCS11',datafile45,"all")><!---NEW_TRAD MM --->
         
        
        <cfset cleanData = replace(cleandata,'PHCS12',datafile46,"all")><!---NEW_Simply Blue - HRA --->
        <cfset cleanData = replace(cleandata,'PHCS13',datafile47,"all")><!---NEW_Simply Blue --->
        
        
        <cfset cleanData = replace(cleandata,'PHCSRX1',datafile48,"all")><!---NEW_3 Column Rx --->
        <cfset cleanData = replace(cleandata,'PHCSRX2',datafile49,"all")><!--- NEW_5 Column Rx--->
        <cfset cleanData = replace(cleandata,'PHCSRX3',datafile50,"all")><!--- NEW_6 Column Rx--->
        <cfset cleanData = replace(cleandata,'PHCSRX5',datafile51,"all")><!--- NEW_Blue Advantage--->
        <cfset cleanData = replace(cleandata,'PHCSPLAN1',datafile52,"all")><!---NEW 2_1_HCR --->
         <cfset cleanData = replace(cleandata,'PHCSPLAN2',datafile53,"all")><!---NEW MED-E-FILL --->--->
       
      <cfset cleanData = replace(#cleandata#,"&gt;","","all")>
      
      
      
      <cfset cleanData = replace(#cleandata#,"/y_b_g-dev/intranet/Project_Editor_Agency/Obi_Status_Check-MA/Xinha/examples/images/iconButtonUp.gif",		                                             "images/iconButtonUp.gif","all")>
      
      <cfset cleanData = replace(#cleandata#,"/y_b_g-dev/intranet/Project_Editor_Agency/Obi_Status_Check-MA/Xinha/examples/images/icon_magglass.gif","images/icon_magglass.gif","all")>
      <cfset cleanData = replace(#cleandata#,"/y_b_g-dev/intranet/Project_Editor_Agency/Obi_Status_Check-MA/Xinha/examples/images/baag_auto_swoosh.gif","images/baag_auto_swoosh.gif","all")> 
       
       
             <cfset cleanData = replace(#cleandata#,"&gt;","","all")>
      
      
      
      <cfset cleanData = replace(#cleandata#,"/y_b_g/intranet/Project_Editor_Agency/Obi_Status_Check-MA/Xinha/examples/images/iconButtonUp.gif",		                                             "images/iconButtonUp.gif","all")>
      
      <cfset cleanData = replace(#cleandata#,"/y_b_g/intranet/Project_Editor_Agency/Obi_Status_Check-MA/Xinha/examples/images/icon_magglass.gif","images/icon_magglass.gif","all")>
      <cfset cleanData = replace(#cleandata#,"/y_b_g/intranet/Project_Editor_Agency/Obi_Status_Check-MA/Xinha/examples/images/baag_auto_swoosh.gif","images/baag_auto_swoosh.gif","all")> 
       
  
  	<!---		<cfif fileExists("\\pwn401av213\obi-dev\OBI_Status_Check-MA\Xinha\examples\temp#arguments.NPSGroupNumber##arguments.NPSGroupSection##arguments.BPIDReg#bnftchart.obi")>
            <cffile action="delete"
            file="\\pwn401av213\obi-dev\OBI_Status_Check-MA\Xinha\examples\temp#arguments.NPSGroupNumber##arguments.NPSGroupSection##arguments.BPIDReg#bnftchart.obi">
            
            </cfif>--->
            
 <!---#cleanData#"--->

        
            <cffile action="write"  
            file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Xinha\examples\temp#arguments.BPIDReg#bnftchart.obi" 
            output=" 
#cleanData#"

             />

      <cfreturn value>
    </cffunction>

</cfcomponent>

Open in new window

Avatar of SidFishes
SidFishes
Flag of Canada image

I would suggest removing the hard coding of all the documents and create a table to hold your file path and replace strings

then you could either do a one at a time replacement based on form data (from selects)

<cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\#form.MyDoc#.html" 
    variable="datafile"/>

<cfset cleanData = replace(cleandata,'#form.replacetext#',datafile,"all")>

Open in new window



or loop through them all using a query

<cfquery name="getReplaceData"...>
select myDoc, replacetext from mytable
</cfquery>


<cfloop query = "getReplaceData">
<cffile action="read"  
    file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Editor_Templates\SUPPLEMENTAL\#getReplaceData.MyDoc#.html" 
    variable="datafile"/>

<cfset cleanData = replace(cleandata,'#getReplaceData.replacetext#',datafile,"all")>

    <cffile action="write"  file="\\servername\y_b_g-dev\intranet\Project_Editor_Agency\OBI_Status_Check-MA\Xinha\examples\temp#arguments.BPIDReg#bnftchart.obi" 
            output="#cleanData#" />

</cfloop>

Open in new window

This makes your code far more maintainable as you don't need to manually modify the function. You can create a form so users other than yourself can add additonal myDocs & replaceTexts.

also, the loop will only be loading and processing a single file at a time so you won't have to worry about running out of memory (if indeed that is the issue you are seeing)
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
dg - timeout would generally throw an error no?

ie

"The request has exceeded the allowable time limit Tag: cfoutput"
it depends on if he's viewing the processing page directly in the browser ...
armanbena - Sorry to post in your question!

========================================

SID - can you look at this link and give your opinion please?

https://www.experts-exchange.com/questions/28103705/JS-Applications-Frameworks.html 

I neglected to add any zones to this Q other than javascript.
And I can now see that the guy who is responding doesn't know what I'm talking about.
Thanks