![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excel help | moe2266 | UNIX for Dummies Questions & Answers | 2 | 08-06-2007 09:20 AM |
| How to format excel sheets in UNIX?? | Vijay06 | Shell Programming and Scripting | 2 | 05-16-2007 06:01 AM |
| Creating Excel Sheet in Hp-UX | KVSPRASAD | HP-UX | 5 | 02-07-2007 07:16 PM |
| Multiple excel work sheets through UNIX | puspendu | Shell Programming and Scripting | 1 | 05-03-2006 01:28 AM |
| excel | swakoo | UNIX for Dummies Questions & Answers | 2 | 11-23-2004 09:25 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
creating more than 2 excel sheets in C
Hi,
I have a question about using C to write excel file. There is a way to write into a sheet into a file excel, like this: FILE * File; pMyFile = fopen("test.xls", "w+"); fprintf(File, "\n\n"); /* go to the row 2 of the column A*/ fprintf(File, "%s", "Hi pippo!"); /* write the string "Hi pippo"*/ The question is: Is there something like this that allow me to write in a second sheet, in the same xls file? Otherwise is there a package in C or something like that to manipulate excel file? Thank you |
| Forum Sponsor | ||
|
|
|
|||
|
1. the code you show won't compile
2. fprintf(FIle,"\n\n") places two line feeds in the file, that does'nt mean it went to line #2 3. OpenOffice or old Star Office have routines that can manipluate .XLS files. See: www.openoffice.org |
|
|||
|
What you seem to be creating is called a comma-delimited (.csv) file. It can also be tab-delimited In order to have multiple worksheets or workbooks you need a format called BIFF - specifcally BIFF2 or BIFF4.
If you don't like my answer then goto www.wotsit.org -- and look up the file structure for xls files. Open the pdf file on the XP version. It is very large because the format of these files is not trivial. You will find a format called BIFF2 and BIFF4. The records you are writing are not in that format. These formats store separate worksheets/workbooks. And it makes no sense to create a file with worksheets unless it will be opened by OpenOffice or by Micrsoft Excel. There is nothing else I can contribute. |