idiots everywhere

Processing csv reports from your KBC Online Banking: just use awk, dude!

KBC exports bank statements in an awkward format. For instance, there's no structured field for the correspondent's bank account number — this information is lumped together with the description field. Fortunately, awk can come to your rescue

Here is for instance the code that prints your balance

BEGIN {
 FS=";" # this is the field separator
 RS="\r" # linefeed is the record separator, they are probably using AS400 still
}
{ if (NF == 0) next # there's usually some garbage at the end of the file 

  total += gensub(/,/, "", "g",$9) # sum up the total for each record
}
END {
  print "TOTAL", gensub(/(.+)(..)/, "\\1,\\2", "g", total) # print the total
}

Want to know how much you spent on gas? Here is the code to do just that:

BEGIN {
 FS=";" # this is the field separator
 RS="\r" # linefeed is the record separator, they are probably using AS400 still
}
{  if ($7 ~ /PAIEMENT CARBURANT/)  $11="GAS"  sub(/,/, "", $9)
  totals[$11] += gensub(/,/, "", "g",$9)
}
END {
  for (n in totals) {
  print n, gensub(/(.+)(..)/, "\\1,\\2", "g", totals[n]);
}

When EU institutions write about opensource… it reads like a good joke

Here is an excerpt of the Legal aspects of free and open source software workshop notes. Every phrase is a masterpiece.

"When the public agency has decided that open source requirements are particularly important for a specific software acquisition case, the process described in this section can be followed. This process would end in the agency downloading open source software itself, with no fee paid whatsoever. Separately, commercially provided services and support, if required, may be acquired by publishing calls for tender. Note that this process can be abandoned at any point - for instance, if the software cannot be found easily, or evaluated, or once downloaded is found unsuitable for any reason. At that point, the other approach described in the next section can be followed, namely, publishing a call for tender for open source software."