CSV Parser

My single page application at play.kilumanga.com got a new addition last weekend. Like previous features, it’s not too complicated. Just about what one might expect from a night/weekend hobby project at a three-way tug-of-war for attention with a baby and household chores.

Before I get into technical details, here’s a demo:

As the title suggests, it’s a CSV parser. It reads a CSV file into memory, then parses the lines, putting the second and third columns into a map. When processing a new line, it adds the value from the third column to any existing map entries where the key is the string from the second column. The result: one bar per unique name found in the second column, where the value is the sum of all the values for the rows that had that name in them.

While it might be obvious from the demo to any Japanese readers: this app was designed with credit card usage reports in mind. All of the credit card providers I use in Japan provide monthly reports for download, and they all happen to use the same, or mostly similar format. Unfortunately, however, they don’t provide any APIs, or store data for more than a few months. They also provide partial report files, but none of their files have enough metadata to tell whether it is a complete file or not. So there are a few interesting challenges to creating a robust solution that handles all of these CSV files.

There are a few obvious improvements that I can think of at this point (and might implement in the near future) however:

  1. Support for multiple files
  2. Sorting
  3. More flexibility in merging bars
  4. Color picker (including background color when saving to file)
  5. Extending the drag & drop area to the whole window

Leave a Reply

Your email address will not be published. Required fields are marked *