Instructions for using Excel to import CSV password files into KeePass 2.x.
KeePass is a fantastic, freeware password manager. It is also open-source, making it more secure (you can build it yourself). Unfortunately, importing passwords from Excel or CSV files can be problematic. You may receive the error Found invalid data while decoding if the format is invalid. This assumes you are importing using the "KeePass CSV (1.x)" import format. See File Format CSV Import Help for more information. Here are some tips:
Microsoft Excel 2002 can not, by default, produce a file following the above format. Excel does not normally enclose blank fields or numbers in quotes. You also can not copy values out of Excel in the above format. When you copy a value out of Excel that has multiple lines, then Excel adds double-quotes around the value and doubles each double-quote automatically. These issues will cause problems importing multi-line comments and double-quotes via Keepass CSV Import.
The technique below will allow you to use Excel and Word together to generate the correctly formatted CSV file. The Excel formula provided below will generate the correct CSV format. Then, you copy and paste the results into Word and save as a plain text file. This ensures the correct formatting.
Account, Login Name, Password, Web Site, Comments
Your passwords should now be imported without errors!
With minor modification to the formula, you can also use the freeware OpenOffice Calc. With Calc, you do not need to save the formula results via a word processor. You can simply copy column F and paste it into any text editor (such as notepad, Textpad, or UltraEdit). Save the file as a
.csv file, and it will be already correctly formatted and ready to be imported.
For your convenience, I have listed the OpenOffice Calc formula to generate a Keepass version 1.x CSV import file below:
If you enjoyed this article, please link to it from your blog or website.