Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Conditional Import

2 views
Skip to first unread message

sebastian...@googlemail.com

unread,
Oct 26, 2011, 5:46:46 PM10/26/11
to
Hi!

I would like to import data from a very large text file. If I import all the data, Mathematica takes around 9 h to complete. Therefore I would like to import conditionally, that is for example only every 5th element. It would probably be best to do this using low level function. I have found a help topic on this (developing an import converter), however I can not get it to work. Specifically, I do not understand how to implement my own import converter, and how I can then use this to only import every 5th element of a file.

Thank you!


Leonid Shifrin

unread,
Oct 27, 2011, 6:38:32 AM10/27/11
to
As an alternative to writing your own import converter, which is a heavier
approach, you may try Read/ReadList or even BinaryRead/BinaryReadList. These
are fast (especially Binary..) lower-level functions which read from a
stream and might be enough for your purposes.

Regards,
Leonid
0 new messages