Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

".\" added to table name in SQLITE database file #31

Closed
joel0977 opened this issue Feb 15, 2018 · 4 comments
Closed

".\" added to table name in SQLITE database file #31

joel0977 opened this issue Feb 15, 2018 · 4 comments

Comments

@joel0977
Copy link

Hello Simon, thanks a lot for your great tool and sharing.

I am using it to convert a bunch of csv files in a folder. i get a .db file as output; anyhow my table names are marked with a "."chars which do not allow me to perform further sqlite queries...could you please advice me how to avoid this issue?
Below my cmd input and output:
C:~Documents\Profesional\2018-02-15>csvs-to-sqlite C:~Documents\Profesional\2018-02-15 output.db
extract_columns=()
Loaded 4 dataframes
c:\users\joel0\appdata\local\programs\python\python36-32\lib\site-packages\pandas\core\generic.py:1362: UserWarning: The spaces in these column names will not be changed. In pandas versions < 0.14, spaces were converted to underscores.
chunksize=chunksize, dtype=dtype)
Created output.db from 4 CSV files

thanks in advance

@simonw
Copy link
Owner

simonw commented Apr 24, 2018

You can run queries against columns with dots in their names by quoting them, for example:

select * from [my.table.with.dots];

@simonw simonw closed this as completed Apr 24, 2018
@simonw
Copy link
Owner

simonw commented Apr 24, 2018

@MaffooClock
Copy link

When I read the subject of the issue, I thought we'd be talking about how this tool inadvertently added the current directory to the table names (e.g. ".\TableName" for Windows, "./TableName" for *nix).

When I ran the tool against a blob of CSV files (/path/to/files/*.csv), all of the tables were named as expected. But when I ran the tool against a directory (/path/to/files), all of the table names are preceeded with "./".

Seems like a bug to me.

@RobAley
Copy link

RobAley commented Feb 10, 2021

I think this is a bug too, @simonw , on Windows at least.
Wildcards don't work, so if I have test1.csv and test2.csv in a folder called input, I can't do :
csvs-to-sqlite input\*.csv output.db
as it complains "input\*.csv" does not exist. I can do :
csvs-to-sqlite input output.db
and it will correctly get all csv files in the "input" folder. However the resulting tables will be called ".\test1" and ".\test2" rather than just "test1" and "test2".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants