Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeshiyan/file-to-sqlite
Copies data from a file to an SQLite database using regular expressions.
https://github.com/mikeshiyan/file-to-sqlite
composer console file oop php regex sqlite
Last synced: about 1 month ago
JSON representation
Copies data from a file to an SQLite database using regular expressions.
- Host: GitHub
- URL: https://github.com/mikeshiyan/file-to-sqlite
- Owner: mikeshiyan
- License: mit
- Created: 2018-03-16T02:43:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-21T15:22:46.000Z (over 6 years ago)
- Last Synced: 2024-11-15T21:39:30.958Z (about 2 months ago)
- Topics: composer, console, file, oop, php, regex, sqlite
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File to SQLite
A command-line utility for copying data from a file to an SQLite database file
using regular expressions.Perfect for converting automatic log files, reports, etc.
## Requirements
* PHP ≥ 7.1
* [Composer](https://getcomposer.org)## Installation
```
composer global require --optimize-autoloader shiyan/file-to-sqlite
```Make sure that the `COMPOSER_HOME/vendor/bin` dir is in your `PATH` env var.
More info in the composer help: `composer global -h`If you have the [CGR](https://github.com/consolidation/cgr) installed, then run
the following command instead of the one above:```
cgr -o shiyan/file-to-sqlite
```## Usage
```
file-to-sqlite [options] [--]
```##### Arguments:
```
source Path to the source file.
destination Path to the SQLite database file. If not exists, it will
be created.
pattern Regular expression pattern with named subpatterns.
```##### Options:
```
-t, --table=TABLE Table name. By default, the source file name is used.
-i, --integer=INTEGER List of integer fields. (multiple values allowed)
--blob=BLOB List of blob fields. (multiple values allowed)
--real=REAL List of real fields. (multiple values allowed)
--numeric=NUMERIC List of numeric fields. (multiple values allowed)
-p, --primary=PRIMARY Primary key(s). (multiple values allowed)
-a, --append If the table exists, this option allows to insert into it
anyway.
```