This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I wrote a java program that inputs a text file that is delimited by asterisks, and outputs a text file containing an html table. Since Excel recognizes html, this works great. My problem is that a zip code field drops leading zeroes. Is there any sort of formatting that I can use to let Excel know to treat this cell as text?
Have you tried reverse-engineering? Create a spreadsheet, input a number as text in cell A1. Save it as HTML and see what you get.
Joined: Mar 31, 2005
Good idea. I don't have it completely figured out yet, but Excel created a header specifying that the table type was Excel, and I suspect that is what I'll need to do to fix it. Simply copying the table part of the file into a new .xls file didn't do it:
Creating an HTML file and calling it ".xls" is likely to be unstable at best. Using POI (which is not difficult to learn) you can specify that a particular cell contains text, not numbers, and thus avoid having Excel mess around with its contents unpredictably.