___ Sent with SnapperMail www.snappermail.com ...... Original Message ....... On Fri, 6 May 2005 11:05:37 +1000 Jason Schulz <[EMAIL PROTECTED]> wrote: >Steve, > >Are the zip codes you are working with fixed length, or is the pad >length (number of zeros on the front) fixed? > >If you can generate an html file for Excel then CSS can be applied to >tell Excel to treat the numbers correctly. If you want to stay away >from styles, then <td x:str="'001">001</td> will force the Excel parser >to treat the cell as if '001 had been entered manually. > >I know that I'm suggesting HTML as the internal format of the file when >you are using CSV, but if you target is Excel and you want to preserve >leading zeros into Excel, this is one way to do it. > >Regards, > >Jason. > >PS: Tip o' the hat to Scott Cadillac for coming up with the original >that this example is based on. > > ><html xmlns:o="urn:schemas-microsoft-com:office:office" >xmlns:x="urn:schemas-microsoft-com:office:excel" >xmlns="http://www.w3.org/TR/REC-html40"> ><head> ><meta name=vs_targetSchema >content="http://schemas.microsoft.com/intellisense/ie5"> ><meta http-equiv=Content-Type content="text/html; charset=windows-1252"> ><style> >table >{ > mso-displayed-decimal-separator:"\."; > mso-displayed-thousand-separator:"\,"; >} >.zip_fixed_length >{ > mso-number-format:"000-000"; >} >.zip_fixed_pad >{ > mso-number-format:'"000"#'; >} ></style> ></head> ><body> ><table border="1"> > <thead><tr><th>Zip</th></tr></thead> > <tbody> > <td x:str="'001">001</td> > <tr><td class="zip_fixed_length">0877</td></tr> > <tr><td class="zip_fixed_length">012877</td></tr> > <tr><td class="zip_fixed_length">958877</td></tr> > <tr><td class="zip_fixed_length">1958877</td></tr> > <tr><td class="zip_fixed_length">NSW</td></tr> > <tr><td class="zip_fixed_pad">0877</td></tr> > <tr><td class="zip_fixed_pad">012877</td></tr> > <tr><td class="zip_fixed_pad">958877</td></tr> > <tr><td class="zip_fixed_pad">1958877</td></tr>
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf