At 15:29  -0400 2006/05/16, Miller, Raul D wrote:
Joey K Tuttle wrote:
 OK, MS (not bashing women :) Excel - the problem is,
 one often doesn't have the choice "not to use it" in
 the sense that people send files exported from Excel...

And sometimes those files are broken or virus infected,
etc.

When the files are well formed, typically a person could
use openoffice calc to read them and re-export them in
a more convenient format.

Alternatively, you could ask the original user for a copy
of that the file in some other format.

I've gotten quite a bit of mileage from asking people to
save the file as CSV.  In the typical case, CSV is more
than adequate.
CSV tends to be much easier to process programmatically
(assuming you aren't using some simple thing in excel
for your program -- a reasonable assumption for the case
where the user is exporting the file and you are working
with it in J).

Failing that, asking the user to save the spreadsheet as
xml retains all excel features might be easier to deal with
than the default binary format.  However, this is not as
simple as CSV.


Raul,

The files that caused me troubles were requested and
supplied in text or csv format, not binary - the fact
that the last line of those files is sans EOL was
always an annoyance (especially if using cut in j ...)

I just did a little test to see if MS Excel still saves
files that way and indeed files saved as .txt .csv .htm
.prn and .dif all end unceremoniously with no EOL (in
my case no CR since I have Mac Excel). I used my other
bug as a test example - here is the complete .csv file:

ID,NAME
666,MS

(of course this example does have an EOL on both lines)

I learned that the behavior of Excel has changed when
trying to open the above file - it used to say "Invalid
File" - now it says, "SYLK: file format is not valid."
and then crashes when you acknowledge the error dialog.
I suppose that may mean that they are moving towards a
fix for the bug that has been in every version of Excel
I have looked at.... Long live SYLK.

- joey

PS - my version of Excel doesn't include save as XML.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to