Writing to files

sre22
sre22 used Ask the Experts™
on
I am trying to write some data to an excel spreadsheet, but I can't figure out how to do what I need.  I have a spreadsheet that has various columns of information on it, but I want to be able to update just a few columns without affecting the rest of the spreadsheet.  Example:

If I had in my existing spreadsheet:

Name_____Hours_____Fees_____Other info
Joe              5                 100
Jane            4                  80
Jim              3                   60

Now I want to update the spreadsheet to:
Name_____Hours_____Fees_____Other info
Joe              6                 120
Jane            8                  160
Jim              3                   60

How can I do this without affecting the "Other Info" columns.  Basically I need to know how to move to certain lines within the document.  The document is formatted so I know exactly where each line is, so maybe I just need to know how to move to the beginning of the document and then I can count down the rows as I update the info
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2006

Commented:
The easiest way to do that is to use a CSV (comma separated values) file as your spreadsheet file.  You just need to write to plain text file.
Good luck if you want your program to support all sorts of XL files, i have no idea how to do that.

Commented:
You cold use the JDBC to link to an Excel ODBC source and then write to an Excel file like a database.....

But all your client machines would have to have the same ODBC source set up.
Commented:
"Java Excel API - A Java API to read, write and modify Excel spreadsheets "

http://www.andykhan.com/jexcelapi/

Commented:
You might want to have a look at POI available at:
http://jakarta.apache.org/poi

Author

Commented:
All good suggestions but I liked this one the best.  Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial