This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xls to text conversion ?


On Thu, 4 Feb 2010 19:55:36 Maarten Vanneste wrote:
>
> Dear all,
> I was wondering whether there is a cygwin tool/program which converts
> microsoft excel files to text. Any suggestions ?

I use xlhtml, source at:  http://chicago.sourceforge.net/xlhtml/

I applied the following patch:

diff -c ~/xlhtml-0.5/xlhtml/xlhtml.h-org ~/xlhtml-0.5/xlhtml/xlhtml.h
*** ~/xlhtml-0.5/xlhtml/xlhtml.h-org	Thu Apr 11 03:23:51 2002
--- ~/xlhtml-0.5/xlhtml/xlhtml.h	Thu Dec 24 18:16:51 2009
***************
*** 20,28 ****
  #include "version.h"

  /* Used by packed string array Opcode: 0xFC */
! #define HARD_MAX_ROWS_97	0x7FFE    /*!< Used in add_wb_array to prevent OOM */
! #define HARD_MAX_ROWS_95	0x3FFF    /*!< Used in add_wb_array to prevent OOM */
! #define HARD_MAX_COLS		256	      /*!< Used in add_wb_array to prevent OOM */

  static U16 HARD_MAX_ROWS = HARD_MAX_ROWS_97;
  /**********************************
--- 20,28 ----
  #include "version.h"

  /* Used by packed string array Opcode: 0xFC */
! #define HARD_MAX_ROWS_97	0x0FFFF   /*!< Used in add_wb_array to prevent OOM */
! #define HARD_MAX_ROWS_95	0x07FFF   /*!< Used in add_wb_array to prevent OOM */
! #define HARD_MAX_COLS		256	  /*!< Used in add_wb_array to prevent OOM */

  static U16 HARD_MAX_ROWS = HARD_MAX_ROWS_97;
  /**********************************
***************
*** 57,63 ****
  	U16 type;	/*!< This will record the record type that generated the cell */
  	U16 spanned;		/*!< If 1 don't output */
  	uni_string ustr;	/*!< The cell's displayed contents */
! 	U16 rowspan;		/*!< rows to span */
  	U16 colspan;		/*!< columns to span */
  	uni_string h_link;	/*!< If a hyperlinked cell, this is the link*/
  }cell;
--- 57,63 ----
  	U16 type;	/*!< This will record the record type that generated the cell */
  	U16 spanned;		/*!< If 1 don't output */
  	uni_string ustr;	/*!< The cell's displayed contents */
! 	U32 rowspan;		/*!< rows to span */
  	U16 colspan;		/*!< columns to span */
  	uni_string h_link;	/*!< If a hyperlinked cell, this is the link*/
  }cell;


I did it on GNU/Linux but I think it'll work well on Cygwin.

It worked for several years in our company without the patch, but
lately we started receiving Excel files with 65535 lines in one sheet,
so I had to change the hard coded line limit.

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7976-561  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]