Menu

script crashes on files of 2000 lines

Help
2014-02-20
2014-02-20
  • mike_hinson

    mike_hinson - 2014-02-20

    Hi,
    This scripting within NPP is a fantastic concept.
    I wonder if my paticular issue is fixable please?

    I have various formats of data reports that I need to change into tab seperated versions, but I find that anything much over small 500 line files just crash out in various unpredictable ways.

    e.g, if you repeat the following pair of lines to create 2000 lines of test data (my real life data is up to about 8,000 lines or more ideally)

    Device Name: THEDEVICE_88
    Configuration file 'running' for IDX 7777 completed successfully in 34 seconds

    And then try the following:
    editor.pymlreplace(r"\r\nConfiguration ", "\tConfiguration ")

    strange things happen, such as partial replace of \r\n to just \n
    additional repeated parts of the word Configuration apear (e.g. Configuration ation)
    NPP crashes
    Etc.

    This is the full set of changes I want to make for this particular type of data
    editor.pymlreplace(r"\r\nConfiguration ", "\tConfiguration ")
    editor.pyreplace(r": ", "\t")
    editor.pyreplace(r" completed", "\tcompleted")
    editor.pyreplace(r" failed", "\tfailed")
    editor.pyreplace(r" in ", " in\t")
    editor.endUndoAction()

    I am running 32 bit Windows 7 & NPP 6.5.4 & pythonscript 0.9.2.0
    PC has 4GB ram

    Thanks

     
  • Dave Brotherstone

    The bad news: This is a known issue, and it's got worse with newer versions of N++.

    The good news: I'm working on a new version which has this fixed, along with a load of other issues. The search and replace functionality has been completely rewritten and is now significantly faster, and works reliably. I had hoped to release it last weekend, but there are still a few things to do. I'm hoping for this weekend, but may also be later - I'm building a new Python 2.7.6 to integrate in, and the native modules don't all build yet.

    In the meantime, there are some things you can do to make it stabler: In N++, disable clickable links, and highlighting matching tags/comment/php/asp zones (all in the MISC settings). There may be other things that help, but those are known candidates. It still won't be 100% correct, but it should be significantly better.

    Watch this space for the announcement.

    Cheers,
    Dave.

     
  • mike_hinson

    mike_hinson - 2014-02-20

    Thanks for such a fast reply Dave.
    I will follow your twitter & jump on the new version once you get time to roll it out.

    Thanks & good luck.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.