Dave Burke - A freelance .NET Developer specializing in Online Communities

A freelance .NET Developer

When .TXT output is better for my users than .XLS

I talked last week about outputting data to Excel using HTML, so I wanted to use the technique for the afterhours site I'm working on for the primary purpose of generating mailing labels or creating an Outlook contact list. 

Oh, Excel is so intelligent!!  Give me a friggen' stupid spreadsheet package, please.  The problem is that I live in Vermont.  All zip codes start with a “0.”  So instead of a nice list of zip codes that look like, say, 05429 on the mailing labels, we've got the Excel value-added version “5429.”  Yeah, I used the Format Code-->Special-->Zip Code option in Office 2003.  Not a problem.  Everything looks good.  Now I'm going to save the file as the pretty .XLS file it is and point Word 2003 to it.  OH NO, MR. BILL!  THE ZEROS ARE GONE AGAIN!

That's okay.  I don't need to go to sleep yet.  It's not even 2AM yet.  I'm going to use the Format Code-->Special-->Zip Code option and save as a CSV file, or hey, a TXT file too while I'm at it!  They work.   So I have to add a couple of paragraphs to Grandma's Mailing Label Generation Instructional Guide.  I can do that.

Ya know what, this process is way too hard!  I can do it start to finish in 2 minutes, but I'm a nerd.  This is not going to be apparent to anyone using the system, and heaven forbid if they're not using Office 2003!  So I went back to outputting the datafile as a comma-delimited .TXT file.  That way Uncle Henry won't even have to look at the output file, and Word loads it up with a zip code that won't get rejected by the US postal service. 

I wonder if any of those lauded Superstars in the MS Office commercials ever succeeded in generating mailing labels that started with a “0”?

 

Comments

Shannon J Hager said:

gotta love Excel... you can open your 01234 zipcode-containing csv file and then format that column to "text", Excel will say that it will treat the column as text, leaving it exactly the way you entered it, even if you enter a number.

but the 0 will still be missing.

So far, I have never used Excel for anything EVER except to open files someone sent me that must be imported into other formats.
# April 16, 2004 4:42 PM

Dave Burke said:

Shannon "HagER" dude, Thanks for your comments. Its good to know my frustration with Excel is shared. You said it well.
# April 16, 2004 4:44 PM

darrenford said:

Don't forget Excel's 64,000 row limit.
# April 17, 2004 9:50 AM

Dave Burke said:

Darren, Yes, I hit that wall before, but I don't remember it being "that high" :-) thanks for the reminder.
# April 17, 2004 9:53 AM

SecretGeek said:

Wise words, indeed!

And that 'removing zeros' issue is a reall pain.

i often use excel to help generate bulk sql statements when i'm fiddlign with data, or to create bulk code, or to help generate big html tables of data. but it's very clearly not designed for these purposes, as it is too heavy and tries to be too smart.

a 'programmers spreadsheet' would be better. it wouldn't have any notion of formatting, or charts, or auto-complete, or auto-anything, or bold or colours or printing (except as text perhaps). it wouldn't understand dates, for example. but it would be very lightweight in memory, very quick. With excellent support for macro recording, regular expressions, and .net integration. you could write plug-ins to it quickly and easily in any .net language. it would have no practical limitation in the number of rows or columns.

ahhh... i dream of software...






# April 18, 2004 7:16 AM

Dave Burke said:

SecretGeek, I use excel for bulk sql statements, too. A "Programmer's spreadsheet" is a great idea! Maybe someone will give us a URL for it? I dream of a url...
# April 18, 2004 7:47 AM

Mike Schinkel said:

Couldn't someone code it quickly using FarPoint's Spread for .Window Forms?

http://www.xtras.net/products/fpspreadwinforms.asp

# July 6, 2004 6:04 AM

Mike Schinkel [Xtras.Net] said:

Oops! Meant to show my affiliation on that last post.
# July 6, 2004 6:05 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)