Comments (6)
@yajo
Please let me confirm this.
Are the existing options not applicable to your use case?
You can specify a format by using the --format
option for sqlitebiter file
.
And you can set a format as a positional argument for sqlitebiter stdin
.
from sqlitebiter.
Yeah, the point is that I want to pass the file through stdin
but let sqlitebiter guess the format by a filename that I give in an alternate flag. So that if the file is .CSV
or .csv
, for example, sqlitebiter does its magic to get the format automatically, without me having to replicate the same magic upper in the stack.
The use case is that I'm integrating sqlitebiter in a system (Odoo) that stores attachments in a content-addressable manner. The file is named asd9f87a9sd8f97987as987d9a8s7d
. In the database I know it's called something.xlsx
.
I tried by symlinking a something.xlsx
to the source file, but sqlitebiter resolves the symlink and ends up without the suffix it needs to know the format.
Thus, I wanted to just let it guess the format based on a filename that I can pass separately. Something like:
sqlitebiter file asd9f87a9sd8f97987as987d9a8s7d --format-from-filename something.xlsx
something.xlsx
would not exist in this context. It's just a parameter.
from sqlitebiter.
@yajo
I intended my previous comment to suggest that you can specify the conversion format using an option or argument.
For example:
$ cat abcdefg # a CSV format file without extension
A,B,C
ab,1,2
bc,3,4
cd,5,6
$ sqlitebiter file --format csv abcdefg
[INFO] convert 'abcdefg' to 'abcdefg' table
[INFO] converted results: source=1, success=1, created-table=1
[INFO] database path: out.sqlite
Or
$ cat abcdefg | sqlitebiter stdin csv
[INFO] convert 'stdin' to 'csv1' table
[INFO] converted results: source=1, success=1, created-table=1
[INFO] database path: out.sqlite
Are these methods of executing commands not solving your problem?
from sqlitebiter.
Those require my app to know the format of the file. The whole point of this feature request is that I'd love to use sqlitebiter format autodetection, which is already coded here. So do those commands convert the file, but do not solve the issue.
from sqlitebiter.
I feel that the use cases of the --format-from-filename
option is too limited.
How about adding file extension names (xlsx
, etc.) support to the --format
option?
from sqlitebiter.
from sqlitebiter.
Related Issues (20)
- update $archive value to "sqlitebiter_windows_amd64.zip" in get-sqlitebiter.ps1 HOT 1
- How do I specify columns orders when loading form an array of JSON objects? HOT 3
- Handle Wikipedia table faulty boolean design; and HTML headers with row/colspan > 1 (also XLS) HOT 1
- XLS import FAILs when a header cell is blank
- XLSX conversion crashes with NoneType for authorId, seems related to cell comments
- json to sqlLite Error HOT 1
- ODS Support
- Convert excel DATE to sqlite DATE
- Unable to locate package HOT 1
- Retain leading zeros when converting text or --no-type-inference HOT 1
- Support simple hierarchical JSON HOT 2
- Automatically detect and create Primary and Foreign Keys HOT 2
- Better default name for database file
- Non able to create output, starting from a simple html page HOT 4
- incompatibility between pip V22 json output and sqlitebiter HOT 1
- Installation dpkg (.deb package) Failing HOT 1
- Convert to spaces HOT 2
- Add --unescape option HOT 1
- sqlite3.IntegrityError: NOT NULL constraint failed: _source_info_.format_name HOT 2
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 sqlitebiter.