Skip to content

Instantly share code, notes, and snippets.

@pce
Created August 27, 2014 09:26
Show Gist options
  • Select an option

  • Save pce/bd8c3a1a3dadfd445aeb to your computer and use it in GitHub Desktop.

Select an option

Save pce/bd8c3a1a3dadfd445aeb to your computer and use it in GitHub Desktop.
ing-diba export format umsatz.csv -> homebank-import.csv ("Buchung";"Valuta";"Auftraggeber/Empfänger";"Buchungstext";"Verwendungszweck";"Betrag";"Währung";"Saldo";"Währung" -> date ; paymode ; info ; payee ; description ; amount ; category )
#!/usr/bin/ruby
require 'csv'
bank_csv = Array.new
CSV.foreach("umsatz.csv", { :col_sep => ";" }) do |row|
bank_csv << [row[0].gsub(".", "-"), 0, row[4], row[2], row[4], row[5].gsub(",", "."), row[3]]
end
CSV.open("homebank-import.csv", "wb", { :col_sep => ";" }) do |csv|
bank_csv.each do |val|
csv << val
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment