The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Win32::OLE open excel file as read only dguy Shell Programming and Scripting 0 03-11-2008 05:32 PM
how to read the data from an excel sheet and use those data as variable in the unix c Anne Grace UNIX for Advanced & Expert Users 1 03-03-2008 04:21 AM
Script to generate text file from excel file isingh786 UNIX for Dummies Questions & Answers 1 01-24-2008 07:32 AM
text file to excel or csv srikanthus2002 Shell Programming and Scripting 9 04-25-2007 09:53 AM
How to attach an excel file/ dat file thru unix mails diwakar82 Shell Programming and Scripting 1 01-06-2006 08:23 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-30-2005
Registered User
 

Join Date: May 2005
Posts: 48
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
Reply With Quote
Forum Sponsor
  #2  
Old 06-30-2005
Registered User
 

Join Date: May 2005
Posts: 48
aditional information

i am using C on Unix (Sun 5.7)
thanks.
Reply With Quote
  #3  
Old 06-30-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,003
just an FYI: catdoc
Reply With Quote
  #4  
Old 06-30-2005
Registered User
 

Join Date: May 2005
Posts: 48
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
Reply With Quote
  #5  
Old 06-30-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,003
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.
Reply With Quote
  #6  
Old 07-01-2005
mbb mbb is offline
Registered User
 

Join Date: Aug 2001
Location: UK
Posts: 103
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
__________________
Senior Analyst/Programmer
Reply With Quote
  #7  
Old 07-01-2005
Registered User
 

Join Date: May 2005
Posts: 48
thanks

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

thanks
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0