View Single Post
Old January 29th, 2018, 06:40 AM   #18
beutelwolf
paludicolous paravant
 
beutelwolf's Avatar
 
Join Date: Sep 2005
Location: Perfidious Albion
Posts: 26,735
Thanks: 75,664
Thanked 745,384 Times in 26,855 Posts
beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+beutelwolf 2500000+
Default

Quote:
Originally Posted by effCup View Post
Re. the loss of leading zeros (due to Excel):

I've been re-looking at the raw data & have improved my regular expressions so that it'd be a bit less manual work to re-do the data into columns (mostly), but the thing is that I think the only way to prevent Excel stripping the leading zeros is to put a ' before them, and unlike where one does that manually within Excel, if I do that to the text file prior to importing into/opening with Excel (that's the only reasonable/manageable way, given the quantity), then they remain visible within excel. That is: Excel then doesn't treat them as "special" characters. So: that way keeps the leading zeros but also prepends a '. So I still wonder whether it's really worth all the effort of re-doing the data?
I found this when googling (actually: bing-ing) the issue:
Note: When Excel opens a .csv file, it uses the current default data format settings to interpret how to import each column of data. If you want more flexibility in converting columns to different data formats, you can use the Import Text Wizard. For example, the format of a data column in the .csv file may be MDY, but Excel's default data format is YMD, or you want to convert a column of numbers that contains leading zeros to text so you can preserve the leading zeros. To force Excel to run the Import Text Wizard, you can change the file name extension from .csv to .txt before you open it, or you can Import a text file by connecting to it.
beutelwolf is offline   Reply With Quote
The Following 8 Users Say Thank You to beutelwolf For This Useful Post: