divide article into 50 tabs
-
I’ve notebad text conatin 50 articles in the same text, every article ends withe the word (end).
I want to divide the 50 articles into 50 taps in notebad++.
How could i do that please using notebad++? -
Notepad++ does not have a “split file into multiple files” feature.
If you know a programming language, then you could write a script in one of the scripting plugins, like PythonScript, LuaScript, or similar – but if you knew a programming language, that would have been your first thought, rather than trying to do it inside a text editor.
You could semi-automate it in a macro: record a macro for the steps (0) start recording, (1)
Ctrl+Home
to go to the top, (2)Ctrl+F
=> FIND =(?s)\A.*?^end(\R|\Z)
, FIND NEXT, exit dialog, which will highlight the first “article”, (3)Ctrl+X
to cut the text, (4)Ctrl+N
to create a new empty file, (5)Ctrl+V
to paste the text into the new file, (6) stop recording. After recording it for the first time, your first article is almost done, and you can justCtrl+S
to save (and give it a name) and thenCtrl+W
to close that new tab, which will then take you back to your original tab. If you are doing this just this one time, no need to save the macro, but if you’ll be doing this in the future as well, you can save the macro with a name, and even give it a keyboard shortcut. To finish for this group of 50 articles, you would just need to run the article and save/close another ~49 times. (Unfortunately, you cannot have a save-file-and-ask-for-name in a recorded macro, that I remember, so you could not include the save-and-close in the macro. Which means you cannot just use the Run a Macro Multiple Times… command to run it 50 times automatically for you, which would have been nicer for you. But this could still work if you’re patient)I think that an external utility, rather than Notepad++, might be your best bet: search the internet for “windows utility to split file into multiple files based on keyword” or some such, and you’ll probably find a plethora, though we cannot help you with any of those.
If you are willing to use a script inside Noteapd++ with one of the scripting plugins, you might search the forum for “split file pythonscript” or similar, because I have vague recollections of someone asking for a similar task before, so if you can find that post, you might be able to use a script that someone wrote for them.)
-
@faridalabib If it’s just 50 articles then you are likely better off doing the split by hand. Doing it by hand should take less time than it would take to figure out how to script splitting a file into 50 parts, debugging it, etc.
One hint is to number your 50 files from 01, 02, 03, … 49, 50 using leading zeroes for 1 to 9. Then it will be easy to reassemble the 50 files into one large file again to verify that it’s the same as the original large file containing 50 articles.