I have an excel spreadsheet which contains addresses. I'm reading the data from the spreadsheet using OLEDB and storing it into a DataTable. I then loop through the DataTable and create my output, which is written to a .csv file. I'm doing all of this in C#.
Here's the problem: When I open the .csv file, any zip codes that were hyphenated have been replaced with 0's.
12345-1234 --> 0
So I want to correct this behavior so that the zip code appears as it should. If i have to chop off the digits after the hyphen, that would be fine. How can I ensure the zip code gets transferred?
Also, is there something I can do in code to maintain the leading 0's in a zip code? Zip codes like this:
01234 --> 1234
Is there something I can do in code to keep the leading 0?