Just a reminder - All Enterprise, Teams, Families, and Premium subscribers receive priority support at bitwarden.com/contact
Exporting Vault to format CSV will result in values that start with 0 to omit the 0.
And when we import that edited vault to Bitwarden, naturally, the unintended changes will be uploaded and take effect.
Worse, we cannot change it.
So, let’s say there is a value “0163” in a cell of the exported vault.
When I open the CSV file in Excel, the value will be “163”
I change the type of data to all cells as TEXT
Edit it the cell back to become “0163”
Save and close the file.
Open the same file again
The value has reverted to 163.
Well… actually the issue is your spreadsheet. If you open the csv file in notepad (or another plain text editor), you’ll see that the zero’s are retained.
What you can do, is during the process of importing (in the popup dialog), select all columns and explicitly set them to “text”. If you don’t do this, then once they’re imported, the zeroes are indeed lost. The importance is to use your spreadsheet program correctly.
But the export of BW does a perfect job.
However, given that I use Microsoft Excel which is the more popular spreadsheet program out there to edit the file, I worry this might be cause problem unknowingly to other users.
Also, I have tried uploaded the exported CSV file to google sheet and it too omited the leading 0, so it is not Microsoft alone.
Though, I find that if the value contains space, then it is displayed perfectly. So, a “08123” will be converted to “8123”, but a “081 23” will still remain as “081 23” when opened by Microsoft Excel and Google Sheet.
Indeed gnulab… every spreadsheet (also LibreOffice) will by default assume a cell consisting of only digits to be a number. There physically is no way to explicitly set field types in a CSV file. A “comma separated values” file will just contain the values. It really is up to the user to explicitly set the column type when importing a csv into a spreadsheet. The only other solution would be to export the values in an xls-file. But this would be wrong for so many reason:
You’re putting it in a closed/proprietary format
This format actually allows you to embed scripting.
This adds a lot of noise to a file if you need to parse it programmatically
CSV basically is the standard.
It’s like requiring tomatosoup not to be liquid anymore because so many people use forks to eat their meat and there are meat balls in tomatosoup.
Actually, it is entirely possible to set field types when importing a CSV into Microsoft Excel. You just needs to use the get data as text function from within a blank worksheet:
Just be careful to set the correct columns as text (e.g., numbers beginning with leading zeros), and everything should open and save correctly. Cheers!
Just a reminder (to those who don’t already know) that spreadsheets by default, especially Excel, create either offline copies or autorecovery temp files (or both) of the files you open on disk in some random folder. You can tell Excel to NOT create these auto backups. The older Notepad.exe does not, and is safe for opening local vault exports (which I keep in a VeraCrypt container). UltraEdit is another good editor option, as it has a Columns feature that works well with CSV data (and JSON) and you can disable temp files altogether.