Configuration

Configuration parameters

"enable_rainbow_csv_autodetect"

Enable content-based separator autodetection.
Files with ".csv" and ".tsv" extensions are always highlighted no matter what is the value of this option.

"rainbow_csv_max_file_size_bytes"

Disable Rainbow CSV for files bigger than the specified size. This can be helpful to prevent poor performance and crashes with very large files.
Manual separator selection will override this setting for the current file.
E.g. to disable on files larger than 100 MB, set "rainbow_csv_max_file_size_bytes": 100000000

"auto_adjust_rainbow_colors"

Auto adjust rainbow colors for Packages/User/RainbowCSV.sublime-color-scheme
Rainbow CSV will auto-generate color theme with high-contrast colors to make CSV columns more distinguishable.
You can disable this setting and manually customize Rainbow CSV color scheme at Packages/User/RainbowCSV.sublime-color-scheme
Do not customize Packages/User/RainbowCSV.sublime-color-scheme without disabling the setting, it will be rewritten by the plugin

"rbql_backend_language"

RBQL backend language.
Allowed values: "Python", "JS"
In order to use RBQL with JavaScript (JS) you need to have Node JS installed and added to your system path.

FAQ

How does RBQL work?

Explanation of simplified Python version of RBQL algorithm by example.

User enters the following query, which is stored as a string Q:

SELECT a3, int(a4) + 100, len(a2) WHERE a1 != 'SELL'

RBQL replaces all a{i} substrings in the query string Q with a[{i - 1}] substrings. The result is the following string:

Q = "SELECT a[2], int(a[3]) + 100, len(a[1]) WHERE a[0] != 'SELL'"

RBQL searches for "SELECT" and "WHERE" keywords in the query string Q, throws the keywords away, and puts everything after these keywords into two variables S - select part and W - where part, so we will get:

S = "a[2], int(a[3]) + 100, len(a[1])"
W = "a[0] != 'SELL'"

RBQL has static template script which looks like this:

for line in sys.stdin:
a = line.rstrip('\n').split('\t')
if %%%W_Expression%%%:
out_fields = [%%%S_Expression%%%]
print '\t'.join([str(v) for v in out_fields])

RBQL replaces %%%W_Expression%%% with W and %%%S_Expression%%% with S so we get the following script:

Result set of the original query (SELECT a3, int(a4) + 100, len(a2) WHERE a1 != 'SELL') is in the "result.tsv" file.
It is clear that this simplified version can only work with tab-separated files.

Is this technology reliable?

It should be: RBQL scripts have only 1000 - 2000 lines combined (depending on how you count them) and there are no external dependencies.
There is no complex logic, even query parsing functions are very simple. If something goes wrong RBQL will show an error instead of producing incorrect output, also there are currently 5 different warning types.

Standalone CLI Apps

You can also use two standalone RBQL Apps: with JavaScript and Python backends