Normal Topic [Solved] Zip Codes:  Sesame to CSV to Excel (Read 1677 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
[Solved] Zip Codes:  Sesame to CSV to Excel
Nov 27th, 2007 at 12:22pm
Print Post Print Post  
I don't know if this is a Sesame question or an Excel question, but here goes:

I would like to export some customer data out of Sesame into an Excel spreadsheet.  I transition it through a .csv file, which I then open in Excel.  The problem is that many of our customers are in New England, where Zip Codes begin with the digit Zero.  In Sesame the field is formatted as Text.  The data looks fine in the .csv, for example "01887", however, when Excel opens the file the program interprets the data as numerical, tosses the leading zero, and fills the cell with "1887".  Re-formatting the cell as text does not restore the zero, as by this time it has been eliminated completely.

What I've been doing to get around this is to open the .csv file in a text editor and do a "replace all" of "0 with "'0.  Excel interprets the added apostrophe as an indicator that the value is left-justified text.  This extra editing, frankly, is a pain in the butt, and at this point I'm not sure if the apostrophe is actually being stored with the value in Excel.  If it is, it may prove to be a problem if I use the data in some other application, which is likely to happen.

Is there a cleaner way to transition Sesame data into Excel, one that will retain the text formatting?
« Last Edit: Nov 30th, 2007 at 2:09pm by Hammer »  

**
Captain Infinity
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Zip Codes:  Sesame to CSV to Excel
Reply #1 - Nov 27th, 2007 at 1:41pm
Print Post Print Post  
I have just done it in open office and Excel by changing the data type in the import dialog box, in excel its on the 3rd page upper right hand corner, in openoffice its on the first page. Wink
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Zip Codes:  Sesame to CSV to Excel
Reply #2 - Nov 27th, 2007 at 2:58pm
Print Post Print Post  
ProudPoppy is right about what to do.

Excel is trying to be "smart". When importing, unless you specify otherwise, it looks at the values in the first few rows of data to try to determine what type of data is in each column. It usually does pretty well, but Zip codes can trick it into thinking the column contains numbers, especially if none of the ones with leading zeros appear in the first few rows.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Zip Codes:  Sesame to CSV to Excel
Reply #3 - Nov 27th, 2007 at 5:33pm
Print Post Print Post  
Thanks.  Took some doing but I got it to work.  I have never used Excel's import data function before, as clicking on a csv file opens it in Excel.  But this is the way to go, so thanks again!
  

**
Captain Infinity
Back to top
IP Logged