.csv Importer Is Specialized For MindManager Export Files

34 views
Skip to first unread message

Thomas Passin

unread,
Mar 1, 2024, 9:33:50 PM3/1/24
to leo-editor
The process for importing any file delegates .csv files to files exported the MindJet's MindManager program. Using it to import ordinary tabular .csv data produces unusable results on the samples I tried today.  I

Most .csv files contain tabular data and, in my view, should be imported as text files. If there is some internal identifying signature in MindManager's files, that could be used to distinguish them from ordinary .csv files.

I don't know if anyone is still importing MindManager files, or if Leo's import code still works for current versions of its export format.

I would like to have Leo be able to import standard .csv files so I would like to start a discussion about the subject.

Edward K. Ream

unread,
Mar 2, 2024, 6:51:54 AM3/2/24
to leo-e...@googlegroups.com
On Fri, Mar 1, 2024 at 8:33 PM Thomas Passin <tbp1...@gmail.com> wrote:
The process for importing any file delegates .csv files to files exported the MindJet's MindManager program. Using it to import ordinary tabular .csv data produces unusable results on the samples I tried today.

Thanks for this report.

This is a confusing topic. Some notes:

- There is no separate importer for .csv files.
- The import-file command delegates .csv files to the ic.importFreeMind method, which in turn uses the MindMapImporter command.

I would like to have Leo be able to import standard .csv files so I would like to start a discussion about the subject.

I agree this would be a good idea. It will probably be easy to do.

It's too late to do this for Leo 6.7.8. In the meantime, you can write a script that imports directly to text. Here is tested code:

import os
fn = 'README.md'
path = g.os_path_finalize_join(g.app.loadDir, '..', '..', fn)
contents = g.readFileIntoUnicodeString(path)
last = c.lastTopLevel()
p = last.insertAfter()
p.h = fn
c.importCommands.createOutline(p, ext='.txt', s=contents)
c.redraw(p)

HTH.

Edward

Thomas Passin

unread,
Mar 2, 2024, 9:08:21 AM3/2/24
to leo-editor
Thanks for the code.  Can't get much simpler than that!  I have a more general interest, though - getting the import-file command and file drag-and-drop to work right.  The csv matter would be part of that.  It seems to me that Leo ought to have separate import commands for MindManager and ordinary tabular .csv  files, which will be easy enough to arrange.  If the MindManager import command were simply removed, it might bite someone who still uses it.

I think the drag-and-drop code and the import-file code should share as much code as possible.  After all, they do the same job except for how Leo gets the path of the file to be imported (and possibly the location to create the imported file - that could be debated).  Right now they are very different (and the drag-and-drop code is very complex compared with the import-file code).

Edward K. Ream

unread,
Mar 2, 2024, 2:42:05 PM3/2/24
to leo-e...@googlegroups.com
On Sat, Mar 2, 2024 at 8:08 AM Thomas Passin <tbp1...@gmail.com> wrote:
It seems to me that Leo ought to have separate import commands for MindManager and ordinary tabular .csv  files, which will be easy enough to arrange.  If the MindManager import command were simply removed, it might bite someone who still uses it.

Please file a new issue.

Edward
Reply all
Reply to author
Forward
0 new messages