How to save 2000 files at once



  • @A-S243

    A tiny detail you’ve overlooked to specify: How are these files to be named?

    @gurikbal-singh

    That’s just a ridiculous suggestion.



  • Hello @a-s243, @alan-kilborn, @gurikbal-singh and All,

    Oh, my God ! Personally, I cannot imagine my N++ Window containing two thousand new # opened, simultaneously, in a single N++ session !! ??

    Probably, it should be 200, shouldn’t it ?

    Best regards,

    guy038



  • @guy038 said:

    Probably, it should be 200, shouldn’t it ?

    Ha. I’m sure it is 2000. Why? Because there are a lot of bizarre requests in this forum!

    Just like people never give enough background to receive good regex help, it would be nice to know the HOW and WHY of 2000 unsaved files.



  • ok yeah so,

    a) yes i know this is dumb, this is the result of about 3 years of opening a new tab everyday and writing notes in it. we can accept i’m dumb and move on from here

    b) how should they be named? not bothered, just want to be able to grep it for info



  • @A-S243

    you know, that unsaved files are saved files on disk already, aren’t you?
    Check your backup directory, there are your unsaved files.



  • @A-S243

    yes i know this is dumb, this is the result of about 3 years of opening a new tab everyday and writing notes in it.

    This is downright bizarre!

    we can accept i’m dumb and move on from here

    Yes we can!

    You could save the files to independent files on disk with the Pythonscript plugin and the following:

    import os
    
    for (filename, bufferID, index, view) in notepad.getFiles():
        if filename.startswith('new '):
            notepad.activateBufferID(bufferID)
            if editor.getModify():
                filename = os.environ['TEMP'] + os.sep + filename.replace(' ', '') + '.txt'
                notepad.saveAs(filename)
            else:
                notepad.close()
    

    It would put your files in your %TEMP% folder. Change that to whatever you want.



  • Ctrl-Shift-S saves all open files.

    Is it not working? what is your issue?

    or you mean you have not even saved the files even first time, so there is no name or location of these files to auosave?

    Thanks.



  • @V-S-Rawat said:

    or you mean you have not even saved the files even first time, so there is no name or location of these files

    Well that is at least the supposition.



  • Well that is at least the supposition.

    :-) not so obvious. unsaved could mean - opened from hard disk, but not saved after making changes.

    Anyway - would you like to share how you created those 2000 tabs? how did you put different data in those 2000 tabs?

    on that basis, maybe I or someone can tell some method that such data can be directly put to hdd txt files, instead of bringing npp in between, or maybe a pythonscript macro can run while you put those data in 2000 tabs, so that each tab/ file is saved on hdd as it is created.

    Thanks.



  • this is the result of about 3 years of opening a new tab everyday and writing notes in it.

    oh my God.

    I surrender.



  • one method could still be:

    install “Autobackup” plugin of npp, there are 2-3 of that type, you need to study which one will serve your purpose.

    As soon as you install this plugin, it will make backup of all opened tabs in the backup folder (see in configuration - backup), so you have all 2000 tabs saved on hard disk. you move all 2000 files elsewhere, and you get what your asked for.


Log in to reply