Fix corrupted txt file (NULL)



  • hello guys . i got a solution for this issue.
    in fact i got the same problem this morning and the current fille on wich i was working get corrupted and content a serie of NULL character .

    i use recuva as mention . by other to solve that issue .
    this is what i did:

    • don’t update the corrupted file . i you have updated it , don’t save it .
    • run recuva . and in the wizar . access the particular place where your file is located .
    • for the firs time , no need to activate deep scan .
    • at the main page of search in recuva . find advance mode / option
    • click option --> action
    • check scan for non deleted file.
    • click ok
    • start the scan .
    • after the scan. check for your file in the list . and most probably you will find it .
    • check the box to select the file --> click on restore
    • restore in a different location .

    thank you . hope it help you to solve your problem.



  • Hi guys
    I randomly found the best and easy solution. Just run the corrupted file to chrome, instad of null you will see the right code, then just the classic ctrl+u and you have again the code (if is html/css etc) eg for php cannot work for obvious reasons…



  • Hello guys.

    Sorry for warming up this old thread. Don’t know if it is solved yet.

    I had the same problem (correct file size but only NULLs) on some embedded devices (Windows 10 Enterprise IoT 1607) with NPP and other (in-house) applications.

    When changing configuration files on the device using NPP, saving them and immediately power-cycle the device, sometimes the file is corrupted as described above. Sometimes the file (configuration) is written correctly but NPP schows NULLs when reopening. In that case closing and reopening that file shows the correctly saved content (It seems to me as only some NPP-chach is corrupted).

    Anyway, after disabling the write cache on the not-write-protected disk, everything went fine.

    So probably this is NOT an error caused and CANNOT be fixed by NPP.

    HOW TO: Manually Turn Disk Write Caching On or Off

    reg add "HKLM\SYSTEM\CurrentControlSet\Enum\<BUS>\<DISK_NAME>\<INSTANCE_ID>\Device Parameters\Disk" /v UserWriteCacheSetting /t REG_DWORD /d 0 /f && shutdown -r -t 0



  • Hi, right now, i have same problem windows 7 x64 npp 7.5.9.
    Restored by previous version of file windows fuctionality.



  • @dontEatMe

    such issues are hard to track down, as you see it already took sometime before one
    found a reliable way to reproduce this issue but once found a possible fix can be coded.
    In order to help identifying/fixing such an problem it is needed to know what has been done,
    what happened and how is/was npp configured.
    And the best would be if you already know how to reproduce in a reliable way.



  • @dontEatMe said:

    i have same problem windows 7 x64 npp 7.5.9.

    This is BAD as 7.5.9 supposedly fixed this problem!



  • @dontEatMe

    if you say that some of your files got restored by previous versions of the same file using 7.5.9, some possible reasons are:

    • you have multi-instance enabled, and auto backup and periodic snapshot is enabled, and at one time you had the same file opened in 2 different instances without noticing it, where one of them was not saved, which is the version that will be restored, even though you saved the same file with newer contents at the other instance.

    • you have more than one notepad++ installed, eg. an installed one and a portable one, and auto backup and periodic snapshot is enabled, and you have modified the same file from both of them, and one of them was not saved and is restored from the snapshot that contains an older state.



  • @Alan-Kilborn said:

    This is BAD as 7.5.9 supposedly fixed this problem!

    The problem that was fixed was regarding the case you had backup turned on - in some cases a race condition occurred between backup operation and currently running action in the editor.

    There is other possible problem connected with sudden power loss but I don’t think Notepad++ is to blame for this.

    As @redneck-f25 said a few posts above:

    Anyway, after disabling the write cache on the not-write-protected disk, everything went fine.
    So probably this is NOT an error caused and CANNOT be fixed by NPP.



  • Just happened to me. Can’t even recover with the recovery software. It appears notepad++ need to improve the way it saves data, i.e. do not remove the copy of overwritten file until the saving is successful. (I was using one or two version before Notepad++ v7.7.1, have now upgraded though so can’t tell which version it was)



  • Glad to see this is still an issue 3 years after being reported. I just ran into this problem when saving and then closing the laptop lid that initiated a reboot because how else is Windows suppose to destroy your data. I will be taking this opportunity to never use notepad++ again. Thanks.