Save file: name based on clipboardcontent possible?

CleoMatra
2013-10-16
2013-11-10
  • CleoMatra

    CleoMatra - 2013-10-16

    Hai guys/girls,

    i have a very large file, which I want to cut into a lot smaller ones, so a macro is the way to go.

    I want the files created with names based on content from the new files. My macro sofar looks like this:

        <Macro name="EWM" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="0" message="2316" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2442" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2442" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2442" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2178" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="2214_1,NA" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="258" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2300" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2317" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2177" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2025" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2422" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2325" wParam="0" lParam="0" sParam="" />
            <Action type="2" message="0" wParam="41001" lParam="0" sParam="" />
            <Action type="0" message="2179" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2302" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2442" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2178" wParam="0" lParam="0" sParam="" />
            <Action type="2" message="0" wParam="41006" lParam="0" sParam="" />
        </Macro>
    

    In the large file I look for "2214_1,NA", but I want this search be based on the content of the clipboard. I set the clipboard with: "2178"

    Also the name of the file (wParam 41006) I would like to paste. Is it possible?

     
  • cchris

    cchris - 2013-11-10

    You need to consider that macros used by N++ are actually recordings by the underlying Scintilla of user actions. The find/replace recording is a major exception to this principle.

    As a result, no parameter value can be pasted, because they would need to be pasted in shortcuts.xml, which N++ only reads once, at startup.

    This is a job for a script I think. Any would do including sed, but in awk the job would be straightforward.

    CChris

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks