Text qualifiers are used to let a program know that anything between a certain character should be interpreted as it is (Normally text). If you don’t get what ‘adding double quote text qualifier in a csv file’ means; In simple terms this will change a line like this: email,fname,lname,ipaddress to: “email”,”fname”,”lname”,”ipaddress”. Very simple.
I recently found out one of my clients could not add double quotes to his CSV file that contained data he needed to upload. I looked around and the only actual thing I could find was a command prompt style replacer, which doesn’t suite a clients need for simplicity. Programs like Microsoft Excel seem to not want to add double quote text qualifiers in your CSV files, and in some cases will remove the automatically. The client did not have ACCESS, which can actually do this, so it was a problem for him. The download links will be below.

I quickly created my own little VB.NET program to handle adding double quote text qualifiers that is user friendly. It will add double quotes to the beginning, end, and between each delimiter you specify. Currently, there are only a set group of delimiters to pick from, and I didn’t want to get fancy (Custom delimiter) to confuse the customer. This program will in no way ever overwrite a existing file as well so it should be safe to handle with. If you specify the file “Test.csv”, the output file will be “Test-1.csv”, or “Test-2.csv”, etc, depending on what ‘number’ is a free file. It will also handle VERY LARGE FILES because it processes per line rather then the traditional/stupid way of saving everything to an array. This means it is also very fast! I did not add a process bar however as I didn’t want to bother counting the lines before processing a file. More time wasted. Instead, it uses a simple label to display the status of where it is at.
I will provide the source so you can modify the program at will and make it even more fancier. This is very basic and I whipped it up in under 20 minutes. It should contain basic comments so you know what everything does. Hopefully this helps someone!
—
Here is the executable which can be run in Windows 7/Windows Vista. Should work in XP as well: QuoteAdder v1
Here is the source if you want to modify it or check it out: QuoteAdder Source
Related posts:
- DirectX: Trouble with double values not returning a proper precision value after initializing DirectX?
- PHP: Randomizing a text file using PHP + MYSQL, quickly & efficient
- PHP: Easy to use logging class for your scripts.
- Modified: Solmetra Flash Uploader v1.02 (to multi-file uploader) & A quick way to pass variables.
sending...
Just wanted to thank you for this lovely simply to use script that does exactly what I wanted. I’ve spent literally days on Google trying to find a script that would do just this, nothing more, add the quotes to my file without any other hassle and this did the job absolutely perfectly first time and every time since.
Do you have something like this for the Mac? I’m on 10.5, on a MacBook Pro with Intel chip. I’m desperate! Thanks, Sharon
Hi Chris, great blog! I run a training company in the UK and I wonder if you would be happy for us to syndicate your RSS feed on our blogs? I think our clients would appreciate the tips, naturally all posts would link straight back to your blog in tact. Cheers, Paul