Importing from Treepad – many blank characters

Home Forums cherrytree Importing from Treepad – many blank characters

This topic contains 2 replies, has 2 voices, and was last updated by  rah 1 week, 5 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #125368

    rah
    Member

    I’ve been experimenting with importing Treepad data into CT. It works very nicely except for one big problem – all the info in the right-hand panel is filled with MANY blank trailing lines.

    In TP, when you enter info into the right-hand panel, there are no blank lines below where you are typing, so the data has no trailing spaces (unless you do that yourself). But when I import this data into CT, it is filled with many lines of spaces.

    I have included 2 screen snapshots, one showing the original in TP, the other showing the same data after import into CT. In the right panel of each, I have positioned my cursor and then pressed Ctrl-A, to select all the text in that panel.

    As you can see, the TP entry is only selecting the lines with the actual words “When dealing with quotations that extend over more than one paragraph, you need to put quotation marks at the beginning of each paragraph but at the end only of the final one.” This is just to demonstrate that there are no trailing blank characters/lines.

    But the CT entry has not just the words, but then an entire screen full of blank characters.

    This is a problem because if I later try to export the CT data into say a PDF or a text file, I get MANY blank screens filled with all this empty text. This is a big problem for me because I was wanting to view the same data on an Adrnoid tablet but cannot get a good looking file because of all this blank data.

    Can CT be fixed to stop doing this, perhaps? Or is there some workaround that someone knows. Thanks!
    treepad snapshot
    cherrytree snapshot

    #125369

    eureka
    Member

    I don’t know but using SearchMonkey as a search tool I searched cherrytree looking for Treepad …

    Hits found here ..

    cherrytree-0.38.2/modules/imports.py

    Line Number: 1992
    “””Returns a CherryTree string Containing the Treepad Nodes”””
    Line Number: 2003
    class TreepadHandler:
    Line Number: 2004
    “””The Handler of the Treepad File Parsing”””
    Line Number: 2060
    “””Returns a CherryTree string Containing the Treepad Nodes”””

    and in cherrytree-0.38.2/modules/core.py

    Line Number: 1051
    “””Add Nodes Parsing a Treepad File”””
    Line Number: 1053
    filter_name=_(“Treepad Document”),
    Line Number: 1066
    treepad = imports.TreepadHandler()

    My idea is that perhaps the parser might be hacked to purge leading blank lines in imported Treepad documents.

    • This reply was modified 1 week, 6 days ago by  eureka.
    #125371

    rah
    Member

    I am now thinking that Treepad is at fault, not CT. I say this because even though when TP displays info in the right-hand panel it ends it at the last actual character, in fact the FILE that is being used has MANY space characters.

    What makes me think this is because I experimented with exporting an entire file (with many nodes) from TP into multiple text files (in folders – CT can nicely import a set of files like this). When I then look at those plain text files exported by TP, they have many space characters after the final actual text. And indeed, if you look at a TP database file with a programming editor, the file itself also has a ton of trailing blank characters.

    So, I can understand why CT is just taking what it is given – garbage in, garbage out. I guess one way around this is to write say a Perl program to strip out all those offending characters before giving the file to CT (an edit macro – say an Ultraedit macro) could also be used. Oh well…

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.