I am new to powershell and inherited this code so sorry in advance. In the $3 field (,"(.+)
") I have descriptions that read “FTE’s”. The ’ is causing a problem when loading the .sql statement to the database. Can anyone help me understand how to have this powershell statement replace any ’ with a blank in the format below?
{ $_ -match "`"99`",.*" } { $_ -replace "^<.*([0-9]{14}).*`"(.*)`"> `"99`",`"(.+)`",`"(.+)`",**`"(.+)`"**,`"(.+)`"" , 'INSERT INTO $(DATABASE) (LOGTIME, LOGCODE, USER, DESCRIPTION, OBJ_TYPE, OBJ_NAME) VALUES (''$1'', ''99'', '''', "Attribute "$3" was set to "$4" for element "$2".", ''Attribute'', ''$3'' ) -- $5 ' |
Out-File -Append "${strLogFile}.sql"
$intTransCount++
}
Sorry if this post is incorrect in format this is my first post. Thanks for the assistance.