vp-31-csvBCC-csvHB.sh 478 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # Conversione dei csv forniti da Bcc in csv importabili da Homebank
  3. echo "DATE;PAYMODE;INFO;PAYEE;MEMO;AMOUNT;CATEGORY;TAGS" > out_$1
  4. awk 'BEGIN {ORS=""; FS=";" }
  5. $1~/[0-9]/ {
  6. print $1 ";"; #date
  7. print ";"; #paymode
  8. print ";"; #info
  9. print ";"; #payee
  10. print $5 ";"; #memo
  11. print $3 ";"; #amount
  12. print ";" #category
  13. print "" #tags
  14. print "\n"
  15. }
  16. END {
  17. }
  18. ' $1 |
  19. grep -v Saldo |
  20. sed -e's/ */ /g' |
  21. iconv -f cp1251 -t utf-8 >> out_$1