xls to text conversion ?

Maarten Vanneste maarten.w.b.vanneste@gmail.com
Sun Feb 7 09:26:00 GMT 2010


Dear all,

I did not manage to get the perl codes running properly, but then
again, I did not invest too much time in it and I am not familiar with
perl.

I did come across a xls2csv executable, which runs smoothly under
cygwin and can be easily lined up with (g)awk and sed to get to what I
wanted.

Thanks for your suggestions !

With best regards / Vennlig hilsen
Maarten





On Fri, Feb 5, 2010 at 12:59 PM, Ehud Karni <ehud@unix.mvs.co.il> wrote:
> 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



More information about the Cygwin mailing list