Message Boards Message Boards

Import large Excel sheets?

Hi friends. I am having troubles with importing relatively large Excel sheets --not huge, but rather large (60 000+ rows, 150 columns).

When I try to import the database as a whole, I get the following error:

Import::fmterr: Cannot import data as XLS format.

I separated the Excel file into several files, one per column. If I try to import them manually, I can, but if I try to import them programmatically (Map[Import, names], where names are the names of each column file) I get the same error messages,

I increased the available memory, to no avail

<< JLink`;
 InstallJava[];
 ReinstallJava[JVMArguments -> "-Xmx1024m"]

Any tips or assistance are very much appreciated

Francisco

12 Replies

Friends: success! I saved the file as csv and I could import it without problems. The morale: it is still easier in csv...

As some asked, indeed the Excel file had some columns with extra formatting and non-ascii characters, which must be the source of the problems

Thanks to all Francisco

I agree that CSV is the best option. But I ended up having to import 5GB's of excel files (200-300MB each) and the latest Mathematica Import did it without a problem - no Java issues anymore.

That said, I also tried an Excel streamer with some success - the way I used it, it was slower than Import: https://github.com/ExcelDataReader/ExcelDataReader

POSTED BY: Eric Smith
Posted 6 years ago

We're working hard to make XLS and XLSX as robust of an option as CSV, so use whichever format best suits your needs!

POSTED BY: Sean Cheren
POSTED BY: Eric Smith
Posted 5 years ago
POSTED BY: Sean Cheren

Hi Sean. I am using 11.3, Windows 10. The error message I get is: Import::fmterr: Cannot import data as XLS format. $Failed

Posted 6 years ago

What is the exact path the files resides on? Does it perhaps contain a non-ASCII character?

If so, what if you moved it/renamed it to an ASCII-only path?

POSTED BY: Kyle Martin
Posted 6 years ago

Like Kyle mentioned there are some minor bugs with non-ASCII characters on filepaths and perhaps in the file in XLS in 11.3 (only on Windows) which are absolutely being addressed in the next version.

Remember that increasing Java won't help in 11.3 since XLS/XLSX import no longer uses Java!

POSTED BY: Sean Cheren
Posted 6 years ago

Hi Francisco,

What version of Mathematica are you using? Also please let me know what operating system you are using.

-S

POSTED BY: Sean Cheren

Francisco,

I suggest saving the excel spreadsheet as a CSV file and import it into Mathematica from the CSV. Version 11.3 has some big CSV import improvements and there are new options that will handle any data format (ie strings with or without quotes, etc)

Regards

Neil

POSTED BY: Neil Singer
Posted 6 years ago

Hi Neil,

11.3 got some big excel updates as well (it no longer uses Java in 11.3), with even more improvements to come in the next version!

-S

POSTED BY: Sean Cheren

Many thanks Neil. Will try your suggestion and inform if it works.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract