Link to home
Start Free TrialLog in
Avatar of sre22
sre22

asked on

Writing to files

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
Avatar of GrandSchtroumpf
GrandSchtroumpf

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.
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.
ASKER CERTIFIED SOLUTION
Avatar of mr_cool
mr_cool

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You might want to have a look at POI available at:
http://jakarta.apache.org/poi
Avatar of sre22

ASKER

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