Created
July 5, 2011 06:00
-
-
Save pajp/1064316 to your computer and use it in GitHub Desktop.
nordea.fi -> smartbudget.se
This file contains 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
#!/usr/bin/perl | |
# | |
# Script som omvandlar finska Nordeas transaktionslogg till ett format som | |
# är kompatibelt med bankimporten på smartbudget.se | |
# Använd med pbcopy för att placera resultatet i clipboard. | |
# (exportera transaktionerna under fliken "Transaktionsförteckning" i | |
# kontovyn på Nordeas nätbank) | |
# | |
# exempel: | |
# | |
# ./smartbudget.pl < ../Downloads/Transaktioner.txt | pbcopy | |
# | |
# klistra in i importen på smartbudget.se | |
while (<>) { | |
chomp; | |
next if /^Kontonummer/; | |
next if /^Bokningsdag/; | |
s/^[ \t]*//; | |
s/[ \t]*$//; | |
next if /^$/; | |
my ($bokdag, $valutadag, $betalningsdag, $belopp, $motpart, $konto, undef, $referens, $betref, $meddelande) = split /\t+/; | |
next unless $belopp; | |
print isodate($bokdag)."\t".isodate($betalningsdag)."\t".$motpart."\t".$belopp."\n"; | |
} | |
sub isodate() { | |
my ($d, $m, $y) = split /\./, $_[0]; | |
return "${y}-${m}-${d}"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment