Forum Discussion
Data in the column automatically converted into general when i save it in CSV
- Feb 11, 2024
It gives desired result when I open in notepad but in case I open CSV file it auto format to general and date and leading zero missing and result would be 1.202 (desired result is 01.2020)
Well, that's how Excel behaves. Even with the +/- recent addition of the following Options (Excel 365 only, top of my head):
this won't give you what you expect:
The only option I see is to import the CSV via Power Query and set your 1st column as Text (result attached)
Running Microsoft® Excel® for Microsoft 365 MSO (Version 2401 Build 16.0.17231.20218) 64-bit / Windows 11 23H2 - Can't repro.:
In Excel, cell A1 was formatted as Text before entering 01.2020. File was then saved as CSV (Comma delimited) or CSV UTF-8 (Comma delimited). In both cases when opening the file in a Text editor like Notepad (as above on the right) 01.2020 was maintained
- haiLorenzo
It gives desired result when I open in notepad but in case I open CSV file it auto format to general and date and leading zero missing and result would be 1.202 (desired result is 01.2020) - File attached here for more info and if I convert attached file into CSV it will change change text format of date column into general and result is 1.202 instead of 01.2020
- LorenzoFeb 11, 2024Silver Contributor
It gives desired result when I open in notepad but in case I open CSV file it auto format to general and date and leading zero missing and result would be 1.202 (desired result is 01.2020)
Well, that's how Excel behaves. Even with the +/- recent addition of the following Options (Excel 365 only, top of my head):
this won't give you what you expect:
The only option I see is to import the CSV via Power Query and set your 1st column as Text (result attached)
- srreddy_goluguriFeb 14, 2024Copper Contributor
HaiLorenzo
Thanks a lot, your solution almost solved the problem.
- LorenzoFeb 14, 2024Silver Contributor
Not sure what you talk about (Excel options of Power Query) but you're welcome & Thanks for providing feedback