I have a file I created. It’s a very basic text document in TXT format. It should open in Notepad (the default) or Wordpad. Other similar TXT files on the same hard drive work fine. But for some reason, whenever I try to open this file, all I get is a blank page.
I would suspect that the file got accidentally deleted at some point. But when I check its properties, it shows that the file size is 23,997 bytes. So it looks like the file still exists but is inaccessible by what should be normal means.
Any ideas on how I can access this file? Please explain any suggestions in simple terms.
You can use the command line to dump the contents of the file to the screen so you can see what’s in the file. There’s a windows command called ‘type’ that you can use with the following steps:
Start a cmd window
cd to the directory with your file
Dump the contents of your .txt file with the type command like this: type myfile.txt
You can bring up the cmd window by bringing up the Start menu and then type cmd. You should see something called “Command Prompt”. That’s the cmd window.
Seconding Notepad++. When you open the file, it should show the file size in the status bar at the bottom. That should give you a clue whether the entire 23,997 characters are being read or not.
Suggestion from a total non-techie: is it possible that the text color got set to the same as the background color? I somehow did that once. Trying to highlight a line or so made my text suddenly reappear.
In an effort to always rule out the easy and the obvious first …
Have you tried hitting PgDn (Page Down) 10 or 20 times to see if, for some reason, your text got moved down and blank text inserted at the top of the file ?
Similarly, you can navigate to the end (keystroke sequence varies by which computer you have – EDIT: often CTRL+Fn+END) and see if there’s anything at the end of the file.
If notepad++ doesn’t work, and chkdsk doesn’t show a problem, it might be a bad character corrupting the file. vim might work, I use Xemacs since I used emacs when I did most stuff at work on UNIX.
Xemacs is still useful in editing html files, since it doesn’t feel it needs to reformat things for you.
It’s possible that the file got corrupted in a way that confuses notepad into thinking it’s read the whole file. Say, the end-of-file character or NULLs. You can try opening it up in a hex editor to see if there’s anything recoverable in there. Here’s an online one you can try:
I would not recommend that anyone use any variant of vi, unless I held some sort of vendetta against them. pico is just as reliable, and far more user-friendly.
One easy thing you could do is print the file. In the File Explorer, right click on the .txt file and you should see Print in the list of tasks. Click that and it should go to the default printer.
If you go this route, I would definitely do a Print Preview before I actually printed the file, though.
If it did get corrupted, you never know what kind of gobbledygook resulted, including no end of Page Breaks. You could go through a ton of paper and ink with nothing but a few nonsense characters on each page.
I will second this - I use vi-type programs, but I spent a lot of time in the 80s playing Rogue and Hack so moving the cursor using hjkl is second nature.
You do not have to “use” it [though, what do you mean? It should work fine, including mouse gestures.] It is enough to open up the file to see what it displays. For instance null bytes should look like ^@ rather than a blank space on the screen. However, a dedicated hex-editor might indeed be more straightforward for that purpose if you do not need a text editor.
You know you can also just click on the arrow keys or use the mouse, right? Or change the keys to whatever you want? If @Chronos does not like to use Vi that’s fine, definitely not a topic for General Questions, but it is a known-to-be-reliable program for dealing with text files.
In the OP’s case, you would install “Gvim” from the link I gave, then navigate to the mystery file, right-click on it, and if everything was successful there should be a menu option to open it in Vim. Select that, and a window should pop open containing your file. Quit from the menu or Xing the window when you are done.
If you want to use it to write a novel, I dispute the statement about it not being user-friendly: there is a tutorial you can run from the Windows program menu. Takes 20–30 minutes. You would want to then set up infinite undo history (so, for example, going back to the version you had 2 months ago always works), which admittedly is not in the basic tutorial, but is it in Pico’s? If Pico does not support persistent multi-level undo, then that alone disqualifies it from being suitable for real work like programming or writing.
I’ve wondered about reports of corrupted flash drives that claim to leave the directory intact but the file contents are garbage. In a case I was shown it appeared the contents was the same garbage in all the files. Maybe that was the same kind of fake and the directory entries are just pointing to the same location on the device.
I’m having a busy day so I haven’t been able to try some of the suggestions yet (but I thank everyone).
However, it’s not looking good. I tried the suggestion to print out a copy of the file using file manager. It worked in that it printed out the six pages of the supposed text. But they were all blank. So I may have a relatively large file that contains no actual text.
Somebody asked where this file is stored. It’s on the hard drive in the Windows Documents file.
I’ll try some more suggestions over the weekend but I’ve pretty much given up hope on recovering this file.