PowerShell to convert Ulster CSV to HomeBank
Hi, it is not question but more sharing a script I created in Powershell to convert Ulster Bank (Ireland) CSV to HomeBank. I saw the python script but well it is a different option. I just thought it could be useful to other.
Function Convert-
<#
.SYNOPSIS
Convert an UlsterBank CSV file to a HomeBank format.
.DESCRIPTION
1. Download the CSV from your bank
2. Copy it to the $Path folder, e.g. C:\CSV
3. Call the function Convert-
4. it will create the supported HomeBank format with *HomeBank.csv, use this file to import in HomeBank.
#>
Try{
$Path = 'C:\CSV' #Copy your Ulster CSV downloaded
if (!(Test-Path $PathToArchive)
$Files = Get-ChildItem -Path $Path -File | Where-Object {$_.Name -notlike "*HomeBank.csv"}
$File = $_.FullName
#remove empty lines, remove the space before and after the header
$CSV = import-csv "$($File)_rdy.txt" -Delimiter ","
$CSV | ForEach-Object{
$_ |
}
#$CSV |Select-Object Date,ColumnA |Export-Csv -Delimiter ";" -Path D:\new.csv -NoTypeInformation
$CSV |Select-Object Date,Payment,
}
#We move the csv to the archived folder
}
Write-Host "Successfully converted the CSV to a HomeBank format" -ForegroundColor Green
}Catch{
$e = $_.Exception
$line = $_.InvocationIn
$msg = $e.Message
Write-Host "caught exception: $e at $line" -ForegroundColor Red
Write-Host "Message exception caught is $msg" -ForegroundColor Red
}
}
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- HomeBank Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: