Answer the question
In order to leave comments, you need to log in
Files without extension, how to identify and assign an extension to each file in a folder?
There are files without an extension, some doc if you open them in a text editor at the very bottom writes an office word document, some just zip archives, some docx opens with an archive, but I know their structure.
But there are more than 300,000 files and it's simply not realistic to sort through all this manually in a short hour.
I searched on Google, but apart from what I already knew, I didn’t find anything, but here’s what I knew: kompum.ru/windows/kak-opredelit-tip-fayla-bez-rass...
Tell me
how this can be automated, thanks in advance!
Answer the question
In order to leave comments, you need to log in
I coped with Google, here you are: https://www.raymond.cc/blog/how-to-recover-chk-fil... Can you handle English?
Open the file, read the header, add the extension according to the header. Only the header of doc/xls/ppt/msi and a bunch of other types is the same, so to understand the exact type, you need to dig more into the file and look at the names of the streams. As you already correctly noted, docx/xlsx are ZIP archives, and you will also have to poke around to distinguish a stupid archive from DOCX.
The second option is to look for a tool like unix file, set it on each file, see the type it returned, rename it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question