It keeps looking at your source file, then adding those changes to your output, since the source file doesn't change, it keeps adding those to the output
$data = @(
@{
pattern = "LACTION 'SQL\(''logility_prod_scp_logility'',"
replacement = "LACTION 'SQL(''LOGILITY_PROD_SCP_LOGILITY'',"
inputFile = "C:\files\DW_FEI_input1.ctg"
outputFile = "C:\files\DW_FEI_output1.ctg"
},
@{
pattern = "LACTION 'SQL\(''dwfei'',"
replacement = "LACTION 'SQL(''DW_FEI'',"
inputFile = "C:\files\DW_FEI_output1.ctg"
outputFile = "C:\files\DW_FEI_output2.ctg"
},
@{
pattern = "LACTION 'SQL\(''DWFEI'',"
replacement = "LACTION 'SQL(''DW_FEI'',"
inputFile = "C:\files\DW_FEI_output2.ctg"
outputFile = "C:\files\DW_FEI_output3.ctg"
}
)
$data |
ForEach-Object {
(Get-Content $_.inputFile) -replace $_.pattern, $_.replacement | Out-File $_.outputFile
}
I used above code..trying many other way's as well..how can i make sure my file sizes are not doubled?
I don't want my file to change size..all the above changes need's to be done on one output file only