Announcing gCSVedit, a simple text editor to edit CSV files

As part of my job at the Université Catholique de Louvain, one of my projects is to develop gCSVedit, a small and simple text editor to edit CSV/TSV files.

gCSVedit is now a free/libre software (GPLv3+ license) and is hosted on GitHub.

Other delimiter-separated values (DSV) files are supported, not just comma-separated values (CSV) files, but “CSV” is more commonly used to refer to that kind of file.

Screenshot of gCSVedit

gCSVedit with the columns aligned. Note also the gray bullets to represent the spaces present in the file.

Why developing a new application for editing CSV files?

CSV files can already be opened in a spreadsheet software like LibreOffice Calc and Gnumeric. But it’s not really user-friendly. Just to open the file you need to provide tons of options:

Screenshot of opening a CSV file with LibreOffice Calc

Opening a CSV file with LibreOffice Calc

A general-purpose text editor like gedit is not the best choice either, because the columns are not aligned. There are some plugins for Eclipse or other IDEs available, but launching and using a complete IDE just to view or edit a CSV file is not user-friendly either.

The best is a specialized application, to do just one thing but do it well. With a user interface that goes straight to the point.

Spreadsheet or text editor?

With a text editor, all characters are visible, including the delimiters. We have thus a greater control. When writing a script to extract the data contained in the file, it’s important to view every character in case of problems (like an extra separator in the data but not for the column titles).

Also, some software that generate CSV files sometimes also include an header, i.e. some text before the actual CSV fields. With a text editor, the header can be shown in a natural way.

Future plans

Create an xdg-app for GNU/Linux. And implement more features of course!

Hopefully in the future it’ll be possible to re-use more code of gedit, to have a decent text editor (although gCSVedit is already completely usable).

So, nothing revolutionary here, it’s a small project. But I think it can bring a better usability. Comments, questions?

PS: to show where are the real spaces (those present in the file, not those added for the alignment), I’ve already contributed to GtkSourceView and GTK+. There will maybe be more contributions in the future, for example to implement a utility to insert virtual spaces, i.e. the text editor should behave as if the added spaces didn’t exist. Or, finally implement rectangular selection in GtkTextView.

Edit: gCSVedit has moved several times where it was hosted, I’ve updated the above URLs.

This entry was posted in gCSVedit, gedit, GtkSourceView. Bookmark the permalink.

7 Responses to Announcing gCSVedit, a simple text editor to edit CSV files

  1. Nelson Benitez says:

    Hello, just to let you know I’ve been working on a implementation of rectangular selection for some time now, hopefully I would be able to submit the patch by january (right now can only work on it on some spare weekends). Anyway I would let you know when I have it ready :-) .


  2. Carl says:

    This would probably be immensely useful for me at work, we however use Windows. While I’ve done some programming it’s not my normal job, and I’ve never tried using GTK+ as a programmer. If I find some spare time I may look into compiling it, in the meantime I hope you can get a Windows installer out soon.

    • swilmet says:

      Most people where I work also use Windows, so having an installer for that OS is required. The latest gedit version can run on Windows (apart from some plugins), so I guess it’ll work fine for gCSVedit.

      But currently gCSVedit depends on GtkSourceView 3.19.1 and GTK+ 3.19.1. GTK+ 3.19.1 is maybe a bit unstable. For a stable release, we’ll need to wait 3.20 in March. And that also means that Windows XP support is not easily possible, since GTK+ dropped its support. But nobody still uses Windows XP nowadays, right?

  3. Peter says:

    Why wouldn’t it be not possible to add an option (dropdown box) in gedit to be able to chose the delimiter? Options could be: “none” (default) –> normal behaviour, “comma” –> column view, etc.

    • swilmet says:

      As is (the current state of the master branch of gCSVedit), it would indeed be easily possible to integrate the feature as a gedit plugin. But other features are planned. It’ll be possible to set on which line are the column titles (if the auto-detection failed). It is also planned to always show the column titles, so when we scroll down in the data, we still see the corresponding titles at the top. Integrate the latter in gedit would be more difficult. And the CSV-specific features would be more difficult to access in gedit, and more difficult to discover. As a gedit plugin, it takes also more time to install and configure.

      Also, “virtual” spaces are not yet supported by GtkSourceView or gedit. When saving a file, gCSVedit is aware of the added spaces for the alignment, and does not save it. As a gedit plugin, it would be more difficult to implement the file saving, and it would not be ideal (the virtual spaces would need to be removed from the buffer).

  4. Neat. This would have been useful at a previous job…

Comments are closed.

Leave a Reply

Your email address will not be published.