How to fix a text file recognized as a binary file? - text

I recently moved some text files from my desktop to external hard drive.
I guess some of the files crashed, and they are recognized as binary files.
When I 'less' them, it says "may be a binary file. See it anyway?".
And when I 'file' them, they look as data files.
Has anybody fixed this problem?
Thank you.

Related

how to make decrypt(human readble file) to mongodb.log.gz

I want to see the log file of MongoDB I have downloaded from MongoDB but when I opening I can see something encrypting text there so I am not able to understand.
please tell me how I make it readable or if I am doing anything wrong please make me correct
I think .gz is a Linux compressed file that you are trying to open in Notepad.
Convert your file to .zip using for example https://convertio.co, and try to open it.
Maybe you will see the right file?

Corrupt Text File read/write/open

I have a large text file that I take notes in; Recently, after saving it, it won't open and gives following error. I tried a few things on web that didn't work---opening in different encoding format, etc. Nothing worked. Any idea how I can open it again? Is there a language I can use from bash? I'm very familiar with PHP. Any ideas? Different text editor?
Error:
"The document “ToDo.txt” could not be opened. Text encoding Unicode (UTF-8) isn’t applicable."
"The file may have been saved using a different text encoding, or it may not be a text file."
cat the file from the CLI and make sure your data is still there. Then you could simply copy and paste the output into a new file and hopefully get rid of whatever weird encodings are causing that text editor to not read the file.

In Linux system file extensions as capital and small lettters

While using linux system I encounter that that many file extensions are in capital as well as small letters like
myfile.JPG and myfile.jpg
I know Linux file system is case sensitive, but what's the difference in these two files? and why sometimes they get saved saved as capital or sometimes in small.
I have seen the same for other file too like
.ttf vs .TTF
Thanks
There is no difference if you name the file myfile.jpg or myfile.JPG or myfile.jpeg. Linux doesn't care.
The extension might be used by some programs running on linux and by humans to easily identify the filetype but it doen't affects the file in any way. You can even call it myfile.dog or just leave it without extension and would be the same image file and for linux it wouldn't make any difference.
If you have an image file and you want to tell what kind of image file it is you can use the file command or if you have imagemagick installed you can use the identify command.
Try renaming some jpeg file and give it a png extension, the run file image.png, you will see that it still is a jpeg file and that the png extension is there only to confuse you.
You might find this usefull: https://www.quora.com/How-do-Linux-identify-file-types-without-extensions-And-why-cant-Windows-do-so

Zip file with .csv extention lost somewhere in filesystem

The file is also locked with winzip and I cant remember the name or directory, I hid it in a very obscure directory. Could be in the windows system files could be in a program directory file. I did a search for all .CSV files I have 4-5K to go through. Any suggestions on how this could be done?
I was opening up files in batches by highlighting a bunch that pressing edit with notepad plus plus. Than going through each one. I know once the file is opened in notepad plus it will not show any words. It is pictures. I own an eCommerce site and I have my master copies that I bought $X,XXX and did not want to take any chances in them be found and resold by other people on my network. Any suggestions?
Opening any zip file in a hex editor suggests that every zip file starts with a data of PK. We can use it in our favour. :)
Download this software: EditPad Pro
What this software does is, it recurses through the whole filesystem starting from a specified base folder to search for any string residing in any of the child files, they maybe Text or Binary, it treats them the same, thus giving accurate results.
In our case, it's a regex: ^PK
When you'll execute this search, the software will return all the files that start with data PK, make sure you do a casesensitive search.

Why odt file can not be opened by zip but can be opened by open office?

I think odt files are ziped files.
Why odt file can not be opened by zip but can be opened by open office?
And a zip file not complete can also be unziped??
Who is familiar with zip format?
ODT files may or may not be zipped. It could also be a plain basic XML file (see http://en.wikipedia.org/wiki/OpenDocument#Specifications).
Also, there are several versions of the ZIP file format that may or may not inter-operate well, so maybe it's just your ZIP utility not being able to read the particular format your ODT file uses.
Rename the file's extension to zip. In that case, it should open with the zip unarchiver (tested with 7-Zip, PowerArchiver, Total Commander).
The problem seems to lie with the archivers' extension sniffing: PowerArchiver (albeit an old, old version) had problems opening the file when the extension was odt, but worked fine with zip.
Of course, the file extension odt will probably be associated with OpenOffice, so double-clicking the file will start OpenOffice.
You can try with 7zip for .odt, If those are zip files, supposed to able to open.
a zip file not complete, you mean broken zip files?, its depends on how its damage. even you can open it, you will not get desired results.
Finally, i found the file is doc format, but saved as odt.
This file is searched by google.
odt files are open office document text files.

Resources