Hello Rob

I just replied to one of your previous messages and I think it went to a yahoo 
account. To save you waiting any longer, I have uploaded the files I spoke of 
to Rapidshare. All you need to do is follow this link, choose the free option 
and download the zip file;

http://rapidshare.com/files/155856446/New_ALZip_zip_File.zip.html

There is a class that reads a CSV file and loads it into an Excel workbook 
along with a small CSV file containing the sort of data I used to test the 
file. Forgive the quality of the code please, it was early on a Saturday 
morning and I am certain it could be refactored.

Talking again about the styles, if you think about it, you already have to 
identify the different types of data to write them into cells so it is easier 
and quicker in my opinion to determine which style to apply at the same time. 
Creating the styles you require at the start of the process will not take too 
long and it has to be quicker than creating a style as you encounter a value 
read from the CSV file, then comparing it with all of the others you already 
have to determine if a suitable style already exists and then setting the style 
for the cell. Comparing styles is not so difficult but it is inefficient IMO, 
the technique I used was simply to call the getXXX() methods for the styles I 
wanted to compare and then actually test the values returned against one 
another!! Not pretty but it did work. Finally, you could use the workbooks list 
if you like as it is possible to call the getCellStyleAt(index) method but you 
would still need to remember - or
 rather your application would - which index value would return you a 
particular style.



--- On Mon, 10/20/08, Rob Y <[EMAIL PROTECTED]> wrote:
From: Rob Y <[EMAIL PROTECTED]>
Subject: Re: HSSFCellStyle - global styles vs individual cell styles
To: [email protected]
Date: Monday, October 20, 2008, 8:28 AM

> After getting up early to watch the qualifying for the next Grand Prix,
I had a few hours to think about the application you are working on and to
throw together a bit of code.Am I correct in assuming that you are reading
in data from a CSV file and using that to populate an Excel spreadsheet?
If so then you may not have any problems with cell styles at all.Typically,
in such an application, you will know in advance just how many different
sorts of cell you will be dealing with and, therefore, how many different
cell styles you need to create. Usually, the problem becomes identifying
the different data types and populating the spreadsheet accordingly.

Yeah, I suppose I could do that.  But my point was that *something's* gonna
have to maintain a list of all the styles I need.  I just thought it would
be neater, since the workbook already maintains a list of all the styles
it's been presented with, if I could use the workbook's list instead of
maintaining my own list.

That technique would be more general-purpose.  Also, it would save me from
having to run a 2-pass process.  My spreadheet is *mostly* populated from
csv data, but there will be other stuff too.


> Take a look at the Java file I have attached to this e-mail. It processes
the CSV file that I have also attached and populates a spreadsheet with the
data.


I don't see an attachment here.  Did you send me a personal email?  If so,
I didn't get it.

I'm pretty familiar with regular expression syntax (years of 'vi'
use'll
do that), I just don't know the Java regex library, but I guess I'll
need
to learn that eventually...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to