how can i read an excel file using C?


 
Thread Tools Search this Thread
Top Forums Programming how can i read an excel file using C?
# 1  
Old 06-30-2005
how can i read an excel file using C?

hi..

i have the next question:

i need to read an excel file (xls) using a C program. Is that possible?
how can i do that?

please, any idea
thanks
# 2  
Old 06-30-2005
aditional information

i am using C on Unix (Sun 5.7)
thanks.
# 3  
Old 06-30-2005
just an FYI: catdoc
# 4  
Old 06-30-2005
problem with catdoc

vgersh99:

i download the file , but i canīt install it
i copy the file and run INSTALL, but then i donīt know what to do...

pllease any idea
thanks
# 5  
Old 06-30-2005
Quote:
Originally Posted by DebianJ
vgersh99:

i download the file , but i canīt install it
i copy the file and run INSTALL, but then i donīt know what to do...

pllease any idea
thanks
Unfortunately I personally have never had a need to do this myself - I just saved this url from one forums I frequent.
# 6  
Old 07-01-2005
Bear in mind that the xls file will have number types encoded in a microsoft specific way, which you will need to the detail of. Not to mention a potential endian difference between your hardware platforms which you will also have to take into account.

Do you have control over how the file is saved? If you do, you might be better off requesting the Spreadsheet be saved as a CSV file.

A CSV file would be ASCII, with each column seaparted by a comma and each row on a single line (delimited by a carriage return).

A CSV file would be much easier for you to parse in a C program or scripting language. Although you will have to interpret string representations of numbers into their internal equivalent. e.g. string to integer type, or string to date type.

Don't forget that a text file originating from DOS will have newline and then control-m at the end-of each line. Unix does not require the control-m character, so any text files will have to be pre-processed in UNIX to remove the control-m characters from the end of each line.

Hope this helps

MBB
# 7  
Old 07-01-2005
thanks

thanks mbb and vgersh99 for your help
i'll try csv method.

thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Read data from excel and upload into html page

Hi, I have requirement for automation, wanna confirm whether is it possible in shell scripting. 1) Need to read data from excel sheet 2) And upload the details in html page I know first requirement is possible by converting excel into csv form, but not sure about the second one. If... (6 Replies)
Discussion started by: stew
6 Replies

2. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

3. Shell Programming and Scripting

Writing excel file using perl : Excel file formatting changed

I am trying to create a program where user can input data in certain excel cells using user interface on internet....the programming is on perl and server is unix But when i parse data into excel the formatting of sheets is turned to default and all macro coding removed. What to do...Please... (7 Replies)
Discussion started by: mud_born
7 Replies

4. UNIX and Linux Applications

Perl Script to read an excel file into an array and search in the UNIX directories

Hi, I want the Perl script with versions 5.8.2 and 5.8.5 starting with #!/usr/bin/perl The Perl program should read the excel file or text file line by line and taking into an array and search in the UNIX directories for reference file of .jsp or .js or .xsl with path .The Object names... (2 Replies)
Discussion started by: pasam
2 Replies

5. UNIX for Dummies Questions & Answers

Read excel file using shell script

Is it possible to read an excel sheet using shell script ? (2 Replies)
Discussion started by: hiten.r.chauhan
2 Replies

6. UNIX for Dummies Questions & Answers

Read microsoft excel in Unix

Hey guys, Can we read a microsoft excel spreadsheet in Unix / linux. If so, what are the steps to be followed? I know we can convert the excel workbook as a CSV and then read it in unix. Are there any other direct methods? thanks prasan81 (2 Replies)
Discussion started by: prasan81
2 Replies

7. Shell Programming and Scripting

Read window Excel sheet to unix

I would like to read data from excel sheet as a input to a shell script. Myproblem is the excel sheet is in windows. How can I write a shell script to read data from that excel sheet? How can I do that?. (4 Replies)
Discussion started by: vj8436
4 Replies

8. Shell Programming and Scripting

Read Ms-excel file in unix

Hi, I have the Ms Excel file(test.xls) in my UNIX box. I would like to read the excel file and create files for each column. Please find an example. My excel file like this data: Num Data 1 a1 2 b2 3 c3 4 d4 5 e5 6 f6 7 h7 My output: I want create 2 files(num.log and... (3 Replies)
Discussion started by: koti_rama
3 Replies

9. Shell Programming and Scripting

use awk to read randomly located columns in an excel file

Hi, I have an excel file that have a random count of columns/fields and what im trying to do is to only retrieve all the rows under 2 specific field headers. I can use the usually command for awk which is awk 'print{ $1 $2}' > output.txt, but the location of the 2 specific field headers is... (9 Replies)
Discussion started by: mdap
9 Replies

10. Shell Programming and Scripting

Win32::OLE open excel file as read only

I am using Win32::OLE to write a perl script which opens an excel file. That excel file is password protected and everytime i run that script dialog box pops up and I have to click on Read-Only then my script executes. Is there any way I can specify the readonly attribute in my code so i dont have... (0 Replies)
Discussion started by: dguy
0 Replies
Login or Register to Ask a Question