Message Boards Message Boards

3
|
11249 Views
|
2 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Get the ExtensionMappings.m file to work?

Hi everyone, I've been setting up my own import converters as described in the Documentation. I keep my converters in $UserBaseDirectory/SystemFiles/Formats. A custom FormatMappings.m file in the same directory works as expected and redirects alternative format names to the correct converter, but ExtensionMappings.m seems to have no effect at all.

My ExtensionMappings.m file reads like this:

{
"*.vesta"->"VESTA",
"*.xtl"->"XTL"
}

The import converters themselves work just fine when I use them in the following form:

Import["file.xtl","XTL"]
Import["file.vesta","VESTA"]

However, if I understand the purpose of ExtensionMappings.m at all, I should be able to do this successfully:

Import["file.xtl"]
Import["file.vesta"]

Even if these specific extensions usually default to import as "Text" (as they seem to do), settings in $UserBaseDirectory should override global defaults, shouldn't they? Is there another config file I need to have, or something specific I need to do within RegisterImport?

POSTED BY: Bianca Eifert
2 Replies

Thanks for your answer! Yes, I see what you did there. (That's one cool package, by the way.) I'm always a bit hesitant to overwrite built-in functions, but it should be fairly unproblematic in this case. I'll probably follow your example.

That said, if anyone has a solution that's closer to "probable intended usage", I'd still be interested.

POSTED BY: Bianca Eifert

When I was trying to do this for my BVH (a motion capture data file format) importer I encountered the same problem. Part of the published documentation simply didn't work as described. You may try to decipher how I solved it in the package on the Mathematica StackExchange.

POSTED BY: Sjoerd de Vries
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