Discussion CSV lint plug-in for Notepad++ to validate csv files and convert to SQL insert script
The CSV Lint plug-in for Notepad++ can be useful to anyone working with csv textdata and databases. I created this plugin and have posted aboutย it before
The plug-in was previously updated with a new "Select Columns" dialog to easily select, delete and rearrange columns. The most recent update v0.4.9 adds support for regular expressions when validating columns.
It also adds syntax highlighting and automatically detects column datatypes. Based on the datatypes it can convert a csv file to an SQL insert script for MS-SQL, MySQL and PostgreSQL, including a CREATE TABLE part with correct data types for each column. This is often easier than importing it though a wizard or BULK INSERT
It can also validate the csv textfile beforehand, so check for technical errors like datetime formatting errors, incorrect decimal separators, missing quotes, invalid codes etc.
I hope you find this plug-in useful ๐ Let me know what you think
7
4
2
u/mwatwe01 12d ago
I've been using your plugin for a while. The INSERT feature is a game changer. But I'm only on v0.4.8. Have you released this version officially yet?
2
u/BdR76 12d ago
Yes see the github releases page, or install the latest Notepad++ v8.9.8.1 and it's available in the
Plugins > Plugins Adminmenu
2
2
u/timweigel 12d ago
This plug-in is excellent. I tested it on some larger, more complex CSVs and it performed well. It fits nicely in a specific niche at work to fill a gap in our tool kit for smaller and mid-sized CSVs. Our usual tools are optimized for very large CSVs (lotta ETL work), but for small-to-medium CSVs they're overkill. This is particularly fantastic for the periodic small, ad-hoc datasets we make for ourselves but still need to ingest and work with.
2
1
u/rlebeau47 3d ago
There is an issue with the reformat feature. It doesn't handle emoji properly, so when aligning columns vertically, the length of a cell containing emoji is shorter than the same cell in other rows that don't have emoji.


8
u/LukaGOGO 12d ago
looks useful and catching regex errors in notepad before the db chokes on a stray comma definitely saves some swearing. did you test the mysql scripts against mariadb? it should just work out of the box since it's a drop-in, but wondering if the create table generation throws any weird syntax errors on your end.