Comments (6)
@KaminoU I just published version 1.5.0, now you can run RBQL even for non-table files - just enter "Rainbow CSV: RBQL" command and it should work! Also updated RBQL supports named columns like a.Age
or a.phone_number
.
If you see any problems - please let me know.
from sublime_rainbow_csv.
Hi @KaminoU ,
In queries without ORDER BY/GROUP BY it is possible to use the following trick:
SELECT * WHERE NR == 1 or re.match('GP001189', a2)
Or something like this if you are doing string transformations:
SELECT int(a3) / 1000 if NR > 1 else a3, *
In more complex cases, I think, the only possible solution would be to use UNION as you suggested, but it is not supported (yet?)
from sublime_rainbow_csv.
The trick works well thx =)
Btw, is there a more friendly way to select on date ? for a specific year for example SELECT * WHERE NR == 1 OR re.match("\d{2}/\d{2}/2019", a55)
regex could be painful... lol
Ayway thank you for this great trick! ^^
from sublime_rainbow_csv.
Sorry to bother you again, is there a way to work directly on an whole row?
We have only columns, designed by a1...a{n} but what if we want to work directly on the whole line?
The main reason I ask it is because I need to know in my input CSV file, if there is any weirds non printable characters or not SELECT count(1) WHERE re.findall('\x0D\x0A', 'full_row')
for example
Thank you again for your reply
from sublime_rainbow_csv.
@KaminoU
For string parsing you can do something like this:
select * where datetime.datetime.strptime(a55, "%d/%m/%Y").year == 2019
If you are often working with the the dates in the same format you can create a UDF in the ~/.rbql_init_source.py
file:
def get_year(src_str):
return year datetime.datetime.strptime(src_str, "%d/%m/%Y").year
Regarding full_rows, I was sure that it is possible to do this, but turns out it is not, so I will have to fix this. For now you can use standalone rbql package with "monocolumn" policy:
$ pip install rbql
$ rbql-py --input /path/to/input.txt --policy monocolumn --delim ''
from sublime_rainbow_csv.
wow!!!!!!! =D
Thank you very much!!! ^^
I am eager to see the new fix for the column and union =)
from sublime_rainbow_csv.
Related Issues (20)
- Does this plugin support multiline column? HOT 5
- Plugin breaks when line is > 16383 characters long HOT 1
- Issue with importing uuid class? HOT 3
- A way to save query HOT 1
- Cannot run query on temporary buffer (i.e. unsaved file) HOT 2
- CSV auto-detection does not work when "A File Icon" package is enabled HOT 5
- The settings file "res://Packages/rainbow_csv/RainbowCSV.sublime-settings" could not be opened HOT 5
- Package disappeared after update HOT 20
- Align columns with spaces adds trailing spaces HOT 2
- Add slice support to the python backend
- The order of colors and a bug with a comma HOT 5
- Improve support for East Asian languages โโwhen using the โalignโ function
- Keybinding HOT 2
- Make generated syntaxes a sub-flavor of `text.csv` HOT 1
- Support multiline fields with arbitrary separators HOT 3
- Option to start columns at 0 HOT 5
- referencing by column name not working..? HOT 4
- use_custom_rainbow_colors has no effect
- Custom colors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublime_rainbow_csv.