'Insert File' in Current Document
-
Maybe this feature is present in Notepad++ but I can’t find it in the menu or on the toolbar. This feature is present in several word processors/editors. Usually in the File menu, there is an option Insert File or something similar. It dumps the content of another file at the current insertion point. I can do so with several files.
I know, it can be done via copy-and-paste. But it is tedious to open a file, select all, copy, go back to the initial file, paste; then repeat with other files you want to insert in the initial one…
Of course, there is the concatenation operation at the command prompt:
COPY file1+file2+…+filen BigFile
That operation is also tedious as you have to type many filenames, some with long names; besides, it is prone to typos.Is this feature present in Notepad++, or I just can’t see it because it is named diferrently? TIA.
-
I too have used other editors that have this “Insert File” feature. Maybe Notepad++ doesn’t have it because it is too easy to do in other ways. For example, I have (in Windows 7) a SendTo menu shortcut called “Clipboard As Contents”. It is fairly self-explanatory but if I wanted to do what you are talking about, I’d locate my desired file to insert in Explorer, then right-click it, choose “Clipboard As Contents”, switch to Notepad++, move to the desired insertion point and press ctrl+v (paste). Dead simple.
An example of how to set up a “Clipboard As Contents” SendTo menu item may be found here: https://www.howtogeek.com/163968/add-the-ability-to-copy-the-contents-of-any-text-file-to-your-send-to-menu/
If this (or ANY) posting was useful, don’t post a “thanks”, just upvote ( click the
^
in the^ 0 v
area on the right ). -
Minor edit due to skipping a step:
I’d locate my desired file to insert in Explorer, then right-click it, then choose “Send To” from the context menu that pops up, then choose “Clipboard As Contents”, then switch to Notepad++, then move to the desired insertion point and press ctrl+v (paste).
-
@Scott Sumner
“Dead simple.”Same difference… only one extra step. Just stay in Npp, instead of switching between Npp and Explorer.
I didn’t ask about workarounds, as I have a few of my own. I wanted a direct Insert File/Text function in the menu. For now, I’ll stick with a specialized app: MDIEditor And Lotto WE.
I do appreciate your courtesy, however. Thanks.
-
I think if the answer on this had exactly answered the original poster’s question, then it would have been a one-word “NO”. That may help the O.P., but it wouldn’t help anyone that might be interested in a real answer, in terms of a good workaround.
I must say, that workaround proposed by @Scott-Sumner240 is so simple it really is better than having a menu item for the functionality in Notepad++. Here’s why:
Explorer can be thought of as a modeless dialog that can always be open, instantly ready to serve files to the clipboard for pasting. If this feature were built into Notepad++, it would be a modal File Open type input dialog that would have to be opened each time. I guess this presumes that one would have the need to insert files into others frequently, but if this wasn’t the case, why would the O.P. ask the question?
Now there WOULD be some utility in having the opposite, a “Save selection to new file on disk…” built-in Notepad++ menu selection. :-)
-
For commands, like merge in file and save selection to disk, that aren’t in NPP, I use the spectacularly good keyboard macro language: Autohotkey (autohotkey.com). It is a real scripting language and can be as simple or complex as you want. I have over 1,000 lines of AHK code. And, naturally, you can make each macro be specific to whatever program, NPP or whatever, that is active.