rubenvar / csv-reader

A browser extension that transforms csv into a readable table, in the same tab
https://chrome.google.com/webstore/detail/csv-reader/dnioinfbhmclclfdbcnlfgbojdpdicde
MIT License
22 stars 3 forks source link
chrome chrome-extension csv csv-data csv-reader firefox firefox-extension html-table transform-data

CSV Reader

What is this?

A browser extension with 3.5k+ users.

It transforms raw csv data into a simple html table, and shows it online in the same tab.

Available free for Chrome and Firefox.

What problem does this solve?

When quickly looking through csv data files online, you either have to:

CSV Reader allows you to look at the data formatted as a table, so you can make decisions faster.

Features

CSV Reader detects if the current tab is a .csv page (correctly most of the time).

The user can select some settings in a popup to modify the output.

NEW: The extension now stores user settings per url for the next time you browse the same file.

NEW: The extension now stops csv files from downloading (it modifies the response headers) so you can parse them in-browser. If you want to download the file just ctrl+s (cmd+s), even in the parsed csv screen.

Output

It offers different options (see images and examples below):

Input

It allows the user to input some settings:

Feature Default Type Result
Separator , String New column when this value is found
Title row false Boolean Use the first line as the table header
Skip at the top 0 Number Number of text lines to leave untouched at the top
Links in text false Boolean Look for links in data and make them clickable

How to use

  1. Install the extension (in Chrome or Firefox).
  2. Head to any .csv data page.
  3. Click on the extension icon, fill the form:
    1. Choose the separator.
    2. Check if there is a title row for the data. This will format a header row in the table.
    3. Input the number of lines to skip at the top. Some csv pages have a few lines with info, we don't want to format those.
    4. Check if there are links in the data. They will be formatted as clickable links.
  4. Click the appropriate button.
  5. Done, enjoy the result!

Example

Visit a .csv data file online. You can try this csv sample dataset.

Click on the CSV Reader extension icon.

In the popup, input the config options: separator, title row, etc. (In the example dataset, | (pipe) as the separator, and check the title line option).

Start

Click "Convert":

Converted

To go back to the raw data, click the "Reset" button on the extension popup:

Reset

Help this project

If this extension was useful to you in any way, please consider leaving a ⭐ 5-star review.

It will take you less than a minute, and will greatly help reach new audiences.

Thank you very much!

Contribute

Suggestions and PRs are welcome, of course. This is (roughly) the dev process:

extension/content_scripts/csv_reader.js contains all the parse and output logic. The browser.tabs queries use Promises, supported in Firefox but not in Chrome, so the extension loads a polyfill for this.

extension/popup/popup.js manages the user input logic, messaging to the main content script, and custom CSS inserts.

To load the unpacked, test extension:

To build and pack the extension, I use web-ext too. It builds the extension folder and creates a .zip file inside extension/web-ext-artifacts.

That's it, there is no further compiling or building process, for now at least.

Some kind of roadmap

Some features I'd like to work on (help appreciated):

Acknowledgments

CSV Reader uses svg icons from Tabler Icons, thanks!