Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combining files in Notepad++

Tags:

file

notepad++

Is there a Notepad++ plugin out there that automatically combines all currently opened files into a single file?

Update: Yes, I am very aware of copy and paste :) I'm working with lots of files, and I want a solution that makes this step in the process a little bit faster than several dozen copy and pastes.

I'm aware of utilities for combining files, but I want the convenience of combining specifically the files that are currently opened in my text editor.

If there isn't a plugin out there already, I'll write one myself; I was just wondering if it exists already to save me the time of developing one.

like image 819
JR. Avatar asked Oct 19 '10 18:10

JR.


2 Answers

http://www.scout-soft.com/combine/

Not my app, but this plug in lets you combine all open tabs into one file.

like image 52
user3330447 Avatar answered Oct 13 '22 19:10

user3330447


I installed the Python Script plugin and wrote a simple script:

console.show()
console.clear()
files = notepad.getFiles()
notepad.new()
newfile = notepad.getCurrentFilename()
for i in range(len(files) - 1):
    console.write("Copying text from %s\n" % files[i][0])
    notepad.activateFile(files[i][0])
    text = editor.getText()
    notepad.activateFile(newfile)
    editor.appendText(text)
    editor.appendText("\n")
console.write("Combine Files operation complete.")

It looks at all the files currently opened in Notepad++ and adds them to a new file. Does exactly what I need.

like image 34
JR. Avatar answered Oct 13 '22 18:10

JR.