• Rob de Vos (5/29/2015)


    I have added a Powershell step that removes the extra " chars.

    I use the | symbol as field seperator which is a regex special char, so the regex expression has a \ in front of the | char to escape it.

    Replace both when you're character is not an special char for regex.

    [font="Courier New"]$ExportFileLocation = 'C:\MyCsvFilesLocation\Exports'

    Get-ChildItem $ExportFileLocation -Filter *.csv | `

    Foreach-Object{

    #write-host $_.Fullname

    (get-content $_.Fullname -ReadCount 0) -replace '(?<!\|)"(?!\||$)',''| set-content $_.Fullname

    }

    [/font]

    So what happens if the full name is supposed to have double quotes in it?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)