3 ms·
This is a very unfair and harsh comment. In my current work, we deal with our user's national identity numbers quite frequently. This number is a 13 digit nume
by beAbU 3y ago
This is a very unfair and harsh comment.
In my current work, we deal with our user's national identity numbers quite frequently. This number is a 13 digit numerical number, that starts with your date of birth. So someone born on March 13 1989 will have a number start with 890913. People born in the aughts have "00" "01" "02" etc at the start of their ID number.
We need to frequently generate excel and csv reports that contain these numbers, and we need to ingest CSVs from other vendors that contain these numbers.
The /moment/ excel touches a CSV with these numbers in, it'll assume that column is a number, it'll strip out the preceding zeros, and it'll format the number in scientific notation. If you change the column's data type to text afterwards, then it's too late - the damage has been done and you've worst case lost data, best case you have a text column full of scientific notation numbers. You can't just open up the CSV, you need to import it, and very explicitly tell Excel how to handle this column, otherwise you mess things up.
Now, anywhere in the chain of people and other vendors sending and receiving these files, anyone who double clicks on that file and it opens up in excel and does not notice this very destructive action messes up our processes and causes unknown amounts of delays. It's the bane of my existence. This exact problem also crops up with phone numbers, where in many countries the number starts with a 0, or if it's an international number, a "+". Excel thinks the "+" makes the field a formula.
All of this because Excel is making assumptions and trying to "help", in the same way a 4 year old helps in the kitchen.
For this reason I find it incredibly frustrating to work with CSVs, because there is no "native" way for me to open the file and interact with the data in a native and intuitive way without running the risk of data being lost or edited without me noticing. I've resorted to importing the files into a local DB instance and using SQL to interact with the data, especially if the files are large.
- vegetable 3y agoYou should never double click to open a csv file in excel. You should ALWAYS import the file into excel. Set your types during import. Many of the complaints about excel's csv handling in this thread are user errors.
- Loranubi 3y agoNot in this case. Excel makes it extra hard for you to do correctly. They encourage the wrong way.