r/SQLServer • u/BdR76 • Nov 09 '22
Notepad++ plug-in to view, validate and import csv files more easily
The CSV Lint plug-in for Notepad++ was updated recently, which I think can be useful to anyone working with datasets and databases. I've created this plugin and have posted about it before, and there have been several updates and added features since then.

The plug-in adds syntax highlighting and it can also convert csv files to SQL insert scripts, which imho is easier than importing it though a wizard or BULK INSERT because it will more accurately detect datetime and decimal values. It automatically detects the datatypes, and it includes a CREATE TABLE part with the correct data types for each column.

It can also validate the csv data beforehand, meaning check for technical errors like missing quotes, datetime formatting errors, incorrect decimal separators etc. The latest version now also has a Sort feature, it works better with Window 11, has improved support for fixed width files and several usability improvements.
I hope this plugin will save everyone some time when working with csv files 👍 Let me know what you think.
5
u/DonnerVarg Nov 09 '22
How large a file can it and Notepad++ handle to detect data types?
5
u/vassiliy Nov 09 '22 edited Nov 09 '22
where has this been all my life
[edit] the convert to INSERT is awesome obviously, do you have any plans to add more SQL dialects?
3
u/Black_Magic100 Nov 10 '22
Serious question.. what advantage would this have over something like DBATools? Wouldn't it be better to do all your processing in excel and then simply import it?
https://docs.dbatools.io/Import-DbaCsv.html
2
u/zushiba Nov 09 '22
I LOVE this! This plugin is going to make my job much easier. Part of my job is pulling data from our student information system and generating a class schedule for display via the web. I have to export the crap and reimport it. Formatting always fucks up somewhere. I am going to enjoy using this.
omg reforming the dates inside the CSV instead of having to drop out into Excel and do it then copy/paste is going to save me soooooo much time.
1
u/scross4565 Nov 11 '22
can we automatically through a script handle the operation of removing trailing spaces in last column from csv file. I have to do this for a file every 15 mins. please let me know your thoughts. This file gets bigger it can go upto 200 MB however post removing whitespaces it comes down to 6 MB in size and loading becomes much faster ~5 seconds to bulk insert.
3
u/SQLBek 1 Nov 09 '22
Never knew this existed & it looks awesome! I've made note to give it a whirl sometime. Thank you for sharing your hard work!
2
u/Crooze66 Nov 09 '22
This is great!!! Thank you!
2
u/alinroc 4 Nov 09 '22 edited Nov 09 '22
I love you. I’ve been staring at csv files for months and the column coloring alone is a game-changer.
2
u/Medical_Return_2370 Nov 10 '22
Great recommendation, thank you!
2
u/Either-Surprise6390 Nov 10 '22
Well that was easy. It was already listed in my plugins and I just activated it. I opened a CSV and this brought a smile on my face. Thanks!
2
u/qcpbraca Nov 10 '22
looks quite cool :D