jokedst / CsvQuery

Plugin for Notepad++ that treats CSV files as (read only) SQL tables
153 stars 28 forks source link

Support for column names with spaces #9

Closed gsahukar closed 6 years ago

gsahukar commented 6 years ago

CSVQuery doesn't support querying columns whose names contain spaces. Export your contacts in Outlook csv format for a sample data set and try this query: select First Name as FN from THIS; You get a "Could not execute query" error dialog

As bad as having spaces in column name is, its worth being supported for such datasets.

jokedst commented 6 years ago

It removes all non-whitelisted characters from column names, and space is one of them, so SELECT FirstName AS FN FROM THIS should work.

The main reason is usability (backtick notation is slower to write) and stability (a LOT of bugs and edge cases avoided).

What is your use case? Do you want to create a new CSV and need the header to be identical? I suppose it could be a feature to remember the original, non-safe string and use it when generating CSVs.

Or is it something else?

gsahukar commented 6 years ago

You guessed it right...I need the original header names to remain the same as the data moves between different systems.

jokedst commented 6 years ago

Try the v1.2.5 release and see if that solves this

jokedst commented 6 years ago

Have you tried 1.2.5? Did it solve your problem?

gsahukar commented 6 years ago

Sorry it took so long; yes it did solve the problem.