0.5.0 • Published 5 years ago

qsv v0.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Process .csv files with a SQL like syntax.

Build Status codecov Maintainability Mutation Score

Gitter Greenkeeper badge

Work in Progress

Currently supports:

  • SELECT
  • WHERE
  • ORDER BY (single column)
  • LIMIT

qsv demo session

npm install qsv -g

Or if you're using yarn

yarn global add qsv

For files with headers:

qsv -p "./path/to/my/file.csv" -h

For files without headers:

qsv -p "./path/to/my/file.csv"

After loading the file you will get into REPL mode, indicated by the QSV> prompt. In REPL mode you can use SQL Queries against your .csv file.

Examples:

SELECT

SELECT * FROM table
SELECT column1, column2 FROM table

WHERE

Supported operators

operatormeaning
=Equal
<>Not Equal
>Greater Than
<Less Than
>=Greater Than or Equal
<=Less Than or Equal

Examples

SELECT * FROM table WHERE column1 > 10

SELECT * FROM table WHERE column1 < 10

SELECT * FROM table WHERE column1 >= 10

SELECT * FROM table WHERE column1 <= 10

SELECT * FROM table WHERE column1 <> Peter

SELECT * FROM table WHERE colum2 = Mexico

ORDER BY

-- ASC is default for ORDER BY so this
SELECT * FROM table ORDER BY column1
-- is the same as:
SELECT * FROM table ORDER BY column1 ASC
-- For descending order you need to add DESC
SELECT * FROM table ORDER BY column1 DESC

table is just a placeholder, you don't need to specify something that makes sense, just don't leave it blank. column1 and column2 are examples for the header fields.

If your .csv file doesn't have headers omit the -h option. Your table will receive enumerated headers in memory, so you can query it like this:

SELECT 0, 1 FROM table

Options

OptionVerbose VersionDescription
-hIndicate that the file to parse has headers
-dSpecifiy the delimiter of your file.
0.5.0

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago