0

I have a plaintext php file in which the content has mysteriously 'dissappeared' The file is 32k and notepad registers 32000 ish characters. When I open in textpad, notepad etc there are loads of whitespace characters. when I open it in vi I see a whole screen of this ^@^@^@ When I opennin notepad++ I see NULNULNULNUL etc Changing encoding in notepad++ does nothing.

I was editing the file in netbeans IDE and have used this setup for a long time, nothing has changed. Encoding is ANSI I don't use any special characters as it is php. The only thing that happened was I accidently engaged Windoze different language when I was typing and it started typing e with accents etc. I did shift ctrl etc to change this until it typed normal characters again.

Clearly something has happened to corrupt this but the file size suggests content might still be there.

Does anyone have any suggestions? Is there even any content to recover or has it all been erased?

I have a backup but it is a little out of date so I will lose a fair whack of work if I can't recover this which naturally I don't want to do.

Thanks.

2
  • There isn't anything to recover. You have 32k null characters, which it sounds like, overwrote the actual that were contained in the file.
    – Ramhound
    Sep 27, 2015 at 13:37
  • Right click the file and check if there is any previous versions of the file or may be the entire folder. (Backup before doing)
    – Nikhil_CV
    Sep 27, 2015 at 16:11

3 Answers 3

1

in NetBeans IDE try: Team -> Local History -> Show Local History

Once you find the snapshot you want, right click the date and choose "Revert from History". (after http://netbeans-org.1045718.n5.nabble.com/Automatic-backup-of-source-files-td2888613.html)

as for Notepad++ - check your %AppData%/Notepad++/backup path for recent files - it helped me more than once in case of N++ crashes..

0

Scroll through the file in notepad++ with wordwrap enabled, and look for anything that isn't NUL. If it turns out the entire file is all NUL, it has effectively been secure-deleted and near impossible to recover.

Unfortunately I can't think of any reason why this would happen in the first place, so only advice is to take more backups I guess. HTH

0

http://www.firstobject.com/dn_editor.htm

  1. Download the foxe (firstobject)
  2. Run the tool
  3. Open the file with encoding you like to convert to. - the text will be displayed correctly.
  4. save the file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .