Last active
June 9, 2023 12:30
-
-
Save floehopper/2286fb86e49d3688f977b5609ea2c1bd to your computer and use it in GitHub Desktop.
Format Aldermore Bank CSV for upload to FreeAgent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://support.freeagent.com/hc/en-gb/articles/115001222564-How-to-format-a-CSV-file-to-upload-a-bank-statement#h_01FWZVYY1GEEGAPKJHG6FKV2HM | |
require 'csv' | |
CSV($stdin, headers: true, skip_blanks: true) do |csv| | |
csv.each do |row| | |
puts([ | |
Date.parse(row['Date']).strftime("%d/%m/%Y"), | |
row['Amount'].gsub(/,/, ''), | |
row['Description'].gsub(/,/, '') | |
].join(',')) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment