[fpc-pascal] Re: read cells contents from .xls file

2013-10-02 Thread Reinier Olislagers
On 01/10/2013 21:44, John Lee wrote:
 Thanks for all suggestions. IMO fpspread...pas is too complex for  I'd
 need to hack thro' thousands of lines - maybe a simple program to read
 xls into csv, as in b) below could be added?.
snip totally irrelevant reference to other programming language

 Guess one could try to use the excel.dll in te reference in fpc  then
 access it from fpc
Good luck with that. I strongly doubt that dll is procedural, so you'd
have to implement support for C++/.Net (whichever it is) object oriented
DLL calling conventions/object support.

 b) using a 10 line vbs program referenced here to create a csv file
 then getting the data from that   
 
 http://stackoverflow.com/questions/1858195/convert-xls-to-csv-on-command-line
 
 This is the way I'm doing it, running the vbs file from cmd using exec
 etc, simple if crude!.  


As already indicated multiple times: fpspreadsheet is about the simplest
code required to read BIFF8 xls files. Of course it can be stripped down
further from a general purpose library to something that just suits your
needs.

You now have indicated multiple times you are not interested in doing
that. Unfortunately for you, I don't think anybody else is, either.

You indicated you wanted to use an outdated FPC compiler to do things
and did not tell you are wililng to use 3rd party tools. Now it turns
out you do use 3rd party tools.

As you indicate: why not simply compile an xls=csv (or whatever)
converter using a recent FPC+Lazarus+fpspreadsheet and use that, then?
You *don't* need to hack through 1000s of lines of code for that. The
examples on the wiki page indicated already show you the code.
Seems you want others to do all the work for you...

Alternatively, you could use Lazarus opendocument to let Excel open an
.xls file with a VBA macro that converts the data to whatever format you
want, etc.

Good luck.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: read cells contents from .xls file

2013-10-02 Thread John Lee
I didn't _want_ to use 3rd part products - I didn't really have any choice
if I wanted to get something working in a finite time, given the 1000s of
lines of code to try to hack, then test when I don't really understand them
 the fact that there isn't any easy fpc solution.

Thanks all for you help.
John


On 2 October 2013 09:44, Reinier Olislagers reinierolislag...@gmail.comwrote:

 On 01/10/2013 21:44, John Lee wrote:
  Thanks for all suggestions. IMO fpspread...pas is too complex for  I'd
  need to hack thro' thousands of lines - maybe a simple program to read
  xls into csv, as in b) below could be added?.
 snip totally irrelevant reference to other programming language

  Guess one could try to use the excel.dll in te reference in fpc  then
  access it from fpc
 Good luck with that. I strongly doubt that dll is procedural, so you'd
 have to implement support for C++/.Net (whichever it is) object oriented
 DLL calling conventions/object support.

  b) using a 10 line vbs program referenced here to create a csv file
  then getting the data from that
 
 
 http://stackoverflow.com/questions/1858195/convert-xls-to-csv-on-command-line
 
  This is the way I'm doing it, running the vbs file from cmd using exec
  etc, simple if crude!.


 As already indicated multiple times: fpspreadsheet is about the simplest
 code required to read BIFF8 xls files. Of course it can be stripped down
 further from a general purpose library to something that just suits your
 needs.

 You now have indicated multiple times you are not interested in doing
 that. Unfortunately for you, I don't think anybody else is, either.

 You indicated you wanted to use an outdated FPC compiler to do things
 and did not tell you are wililng to use 3rd party tools. Now it turns
 out you do use 3rd party tools.

 As you indicate: why not simply compile an xls=csv (or whatever)
 converter using a recent FPC+Lazarus+fpspreadsheet and use that, then?
 You *don't* need to hack through 1000s of lines of code for that. The
 examples on the wiki page indicated already show you the code.
 Seems you want others to do all the work for you...

 Alternatively, you could use Lazarus opendocument to let Excel open an
 .xls file with a VBA macro that converts the data to whatever format you
 want, etc.

 Good luck.
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: read cells contents from .xls file

2013-10-02 Thread Felipe Monteiro de Carvalho
Why cant you download the latest FPC?

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: read cells contents from .xls file

2013-10-02 Thread John Lee
I have it and use it - but not lazarus. But using some legacy 2.2.2
libraries w/o source  want it to work there. Even with latest fpc it
didn't seem very easy to get sheet data into csv, I couldn't follow the
examples in fpspread..., seemed to need lots of lazarus stuff n units that
I didn't understand, just to do something simple, as in my original email.
J


On 2 October 2013 11:20, Felipe Monteiro de Carvalho 
felipemonteiro.carva...@gmail.com wrote:

 Why cant you download the latest FPC?

 --
 Felipe Monteiro de Carvalho
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: read cells contents from .xls file

2013-10-02 Thread Felipe Monteiro de Carvalho
It's really very simple. fpspreadsheet requires lazutils, which comes
inside the source code from Lazarus and lazutils does not require
anything out of FPC.

So if you don't want to use Lazarus, which would automatically solve
the problem, then just pass 2 unit search paths to FPC when compiling
your project which uses fpspreadsheet:

1 Path to fpspreadsheet
2 Path to lazutils (located in the folder lazarus/components/lazutils)

You need to download Lazarus to have lazutils, but you don't have to
use it as an IDE.

Felipe Monteiro de Carvalho


On Wed, Oct 2, 2013 at 1:09 PM, John Lee johnel...@gmail.com wrote:
 I have it and use it - but not lazarus. But using some legacy 2.2.2
 libraries w/o source  want it to work there. Even with latest fpc it didn't
 seem very easy to get sheet data into csv, I couldn't follow the examples in
 fpspread..., seemed to need lots of lazarus stuff n units that I didn't
 understand, just to do something simple, as in my original email.
 J


 On 2 October 2013 11:20, Felipe Monteiro de Carvalho
 felipemonteiro.carva...@gmail.com wrote:

 Why cant you download the latest FPC?

 --
 Felipe Monteiro de Carvalho
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal



 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal



-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: read cells contents from .xls file

2013-10-01 Thread Reinier Olislagers
On 01/10/2013 13:15, John Lee wrote:
 Thanks - as you say (with nice irony) it isn't a simple format, and I
 don't pretend to understand it, indeed it is 'doing my head in'  -  but
 I don't want to write .xls or do charts etc, just read some cells (only
 in in excel 2003, seems to be v11 according to help) - maybe my hope of
 a few lines, with one or two units 'used', isn't possible but there seem
 to be millions of lines here. Is there an example of reading cells from
 named spread that you could point to?

In case you hadn't found it: examples here
http://wiki.lazarus.freepascal.org/FPSpreadsheet

Excel 2003 .xls format is AFAIU BIFF8 as well.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal