Giter Site home page Giter Site logo

csv-to-sql-format's Introduction

csv-to-sql-format

Помогает форматировать наборы значений из csv в выражение sql. Значения из всех столбцов группируются в выражение для фильтрации одного поля.
Полезно при ручном анализе данных в бд, например, через DataGrip.

Осторожно!
csv должен иметь заголовок, иначе в качестве заголовка будет использовано значение в первой строке

При нажатии на текст в нижнем поле (SQL) весь текст копируется в буфер обмена

Пример работы #1
На входе:
date
2016-08-01
2016-08-01
2016-11-01
2016-11-01
2017-06-01
2018-06-01
2018-06-01
2018-06-01
2018-06-01
2018-10-01

На выходе:
date in ('2016-08-01', '2016-11-01', '2017-06-01', '2018-06-01', '2018-10-01')

Пример работы #2
На входе:
date,lag
2020-10-01,2020-08-01
2017-06-01,
2020-10-01,2020-10-01
2021-03-01,2021-08-01
2016-08-01,
2020-05-01,2018-10-01
2018-06-01,2016-11-01
2018-11-01,2020-10-01
2016-11-01,
2021-08-01,2020-10-01

На выходе:
date in ('2020-10-01', '2020-08-01', '2017-06-01', '2020-10-01', '2020-10-01', '2021-03-01', '2021-08-01', '2016-08-01', '2020-05-01', '2018-10-01', '2018-06-01', '2016-11-01', '2018-11-01', '2020-10-01', '2016-11-01', '2021-08-01', '2020-10-01')

Пример работы #3
На входе:
range
11100,
7900,2
3000
5700
5600
6700
4200
1200
2700

На выходе:
range in (11100, 7900, 2, 3000, 5700, 5600, 6700, 4200, 1200, 2700)

csv-to-sql-format's People

Contributors

orthlus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.