Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/2286fb86e49d3688f977b5609ea2c1bd to your computer and use it in GitHub Desktop.
Save floehopper/2286fb86e49d3688f977b5609ea2c1bd to your computer and use it in GitHub Desktop.
Format Aldermore Bank CSV for upload to FreeAgent
# 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