
Dustin Sayes (Customer) asked a question.
Convert CSV to Pipe Delimited
Does anyone have a script to convert standard csv to pipe delimited?
If so, please share.
thank you!

Dustin Sayes (Customer) asked a question.
Does anyone have a script to convert standard csv to pipe delimited?
If so, please share.
thank you!
You could do this with the built in find/replace script as long as there are no values which also contain commas.
I know I'm late to the game here. I'm sure you have what you need by now. I would be curious what solution you have in place today.
We are new customers to MOVEit and I just came across this thread. See below for what we use. It defaults to convert comma delimited to pipe delimited, but you can specify the source and target delimiter via parameters.
This script is courtesy of Tony Perri at Progress. He provided this during our PoC because this was one of our requirements.
This will convert CSV to Pipeline Delimited ignoring anything with double quotes. Works on MoveIT Automation 2024
#==============================================================
# Script to convert from CSV to Pipeline delimited
#==============================================================
Try {
$miaclient.MILogMsg("Converting $fileToConvert from CSV to Pipeline delimited")
$fileToConvert = $miaClient.MICacheFilename()
$miaClient.MILogMsg("Full fileToConvert = $fileToConvert")
foreach($path in $fileToConvert){
$miaClient.MILogMsg("fileToConvert = $path")
$fileContent = Import-Csv -Path "$path"
$miaClient.MILogMsg("Full fileContent = $fileContent");
$newFilePath = $($(Split-Path -Path $path)+"\Converted-"+$(Split-Path -Path $$path -Leaf))
$fileContent | export-csv -Delimiter "|" -Path $newFilePath -NoTypeInformation
$miaclient.MIReplaceCacheFile($newFilePath)
}
$miaClient.MILogMsg( "File(s) converted to Pipeline delimited successfully ")
}
Catch{
# 10000 is a suggested error code for errors in user scripts.
$miaclient.MISetErrorCode(10000)
$miaclient.MISetErrorDescription("Error: " + $Error)
}
RETURN
#End of Script
#------------------------------------------------------------