日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

无法确定本地文件类型_如何从文件内容确定文件类型

發(fā)布時間:2023/12/29 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 无法确定本地文件类型_如何从文件内容确定文件类型 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

無法確定本地文件類型

I. Introduction

一,引言

There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension. This reminded me of questions that come up here at EE along the lines of, "How can I tell the type of file from its contents?", as well as, "What kind of file has the XXX extension?" Writing an article to address this has been on my to-do list for a long time — the group discussion has inspired me to do it.

專家交流小組中正在進行一個有趣的討論- 附件,不帶擴展名 。 這讓我想起了EE中出現(xiàn)的問題,例如“如何從文件內(nèi)容中區(qū)分文件類型?”以及“具有XXX擴展名的文件類型”。 很久以來,寫一篇文章來解決這個問題一直在我的工作清單上,小組討論啟發(fā)了我去做。

II. Determine the type of file from its XXX extension

二。 從文件的XXX擴展名確定文件的類型

Here are five links that can help in determining what an XXX file is:

以下五個鏈接可幫助您確定XXX文件是什么:

http://extension.nirsoft.net/XXX

http://extension.nirsoft.net/XXX

https://www.file-extensions.org/XXX-file-extension

https://www.file-extensions.org/XXX-file-extension

http://www.fileinfo.com/extension/XXX

http://www.fileinfo.com/extension/XXX

http://filext.com/file-extension/XXX

http://filext.com/file-extension/XXX

http://www.solvusoft.com/en/file-extensions/file-extension-XXX

http://www.solvusoft.com/en/file-extensions/file-extension-XXX

Simply replace XXX with the file extension of interest. For example,

只需用感興趣的文件擴展名替換XXX。 例如,

http://extension.nirsoft.net/TIFF

http://extension.nirsoft.net/TIFF

https://www.file-extensions.org/docx-file-extension

https://www.file-extensions.org/docx-file-extension

http://www.fileinfo.com/extension/AHK

http://www.fileinfo.com/extension/AHK

http://filext.com/file-extension/xhtml

http://filext.com/file-extension/xhtml

http://www.solvusoft.com/en/file-extensions/file-extension-opd

http://www.solvusoft.com/en/file-extensions/file-extension-opd

III. Determine the type of file from its contents

三, 根據(jù)文件內(nèi)容確定文件類型

Now to the trickier question! An excellent file identifier application called TrID analyzes the contents of a file in an attempt to figure out what type of file it is. It comes in both a command line interface (CLI) version (for Windows and Linux) and a Graphical User Interface (GUI) version (Windows only) called TrIDNet. The downloads are at the links in the preceding sentence.

現(xiàn)在到棘手的問題! 一個名為TrID的出色文件標識符應用程序分析文件的內(nèi)容,以試圖弄清文件的類型。 它具有命令行界面(CLI)版本 (適用于Windows和Linux)和稱為TrIDNet的圖形用戶界面(GUI)版本 (僅適用于Windows)。 下載位于前一句中的鏈接。

Both the CLI and GUI versions require a database/library of file definitions. This is a key feature of TrID and TrIDNet — the always increasing list of files that it recognizes. As of this article's submission date, the database contains 6,019 definitions (dated 13-August-2015). Note that there are separate downloads for the CLI definitions and the GUI definitions.

CLI和GUI版本都需要文件定義的數(shù)據(jù)庫/庫。 這是TrID和TrIDNet的主要功能-TrID和TrIDNet可以識別的文件列表總是在增加。 截至本文提交之日,該數(shù)據(jù)庫包含6,019個定義 (日期為2015年8月13日)。 請注意, CLI定義和GUI定義有單獨的下載。

IV. More about TrID — the CLI version

IV。 有關(guān)TrID的更多信息-CLI版本

After downloading the CLI version and its definitions, simply unpack the ZIP file with the program (trid.exe) and copy the definitions file (triddefs.trd) into the same folder as the program file. As mentioned above, using a database of definitions for file types is a really nice feature of TrID. Since file types are frequently added, the program author makes the definitions database available as a separate download, so you may go back to the website occasionally to get the latest definitions file.

下載CLI版本及其定義后,只需使用程序( trid.exe )解壓縮ZIP文件,然后將定義文件( triddefs.trd )復制到與程序文件相同的文件夾中。 如上所述,使用文件類型定義數(shù)據(jù)庫是TrID的一個非常不錯的功能。 由于經(jīng)常添加文件類型,因此程序作者可以單獨下載定義數(shù)據(jù)庫,因此您有時可能會返回網(wǎng)站以獲取最新的定義文件。

Here's the syntax of the CLI version (v2.20):

這是CLI版本(v2.20)的語法:

Usage: TrID <[path]filespec(s)...> [-ae|-ce] [-d:file] [-ns] [-n:nn][-@] [-v] [-w] [-?]Where: <filespec> Files to identify/analyze-ae Add guessed extension to filename-ce Change filename extension-d:file Use the specified defs package-ns Disable unique strings check-n:nn Number of matches to show (default: 5)-@ Read file list from stdin-v Verbose mode - display def name, author, etc.-w Wait for a key before exiting-? This help!

The program is free for personal use. Here's exactly what the license says (I took the liberty of correcting typos in it):

該程序免費供個人使用。 這正是許可證所說的內(nèi)容(我可以糾正其中的錯別字):

The program can be freely distributed and is freeware for non-commercial, personal, research and educational use. Contact the author for commercial use or commercialization of TrID or TrID's definitions and contained information.

該程序可以免費分發(fā),并且是非商業(yè),個人,研究和教育用途的免費軟件。 聯(lián)系作者以用于TrID或TrID的定義和所含信息的商業(yè)用途或商業(yè)化。

I don't want to put the author's email address in this article, but you may find it in the Readme file that is part of the download.

我不想在本文中放入作者的電子郵件地址,但是您可以在下載的自述文件中找到它。

V. More about TrIDNet — the GUI version

V.有關(guān)TrIDNet的更多信息-GUI版本

As stated earlier, the definitions for the GUI version are in a different format from the definitions for the command line version. The GUI definitions are in a large number of XML files, one for each file type — currently, 6,019 of them!

如前所述,GUI版本的定義與命令行版本的定義格式不同。 GUI定義包含在大量XML文件中,每種文件類型對應一個XML文件-當前共有6,019個!

As with the CLI version, there's no installation needed — just unpack the ZIP file with the program (TrIDNet.exe) and copy the definitions (all of the XML files) into the same folder as the program file.

與CLI版本一樣,不需要安裝-只需使用程序( TrIDNet.exe )解壓縮ZIP文件,然后將定義( 所有 XML文件)復制到程序文件所在的文件夾中即可。

When running TrIDNet, here's the opening screen:

運行TrIDNet時,這是打開屏幕:

V. Conclusion

五,結(jié)論

To come full circle to the group discussion that prompted this article, I fed to both TrID and TrIDNet a file that has 40 characters in the file name but no file extension. Here's the TrID command line with its result (via copy/paste from the command prompt window):

為了使引起本文討論的小組討論全面進行,我向TrID和TrIDNet提供了一個文件名,該文件名包含40個字符,但沒有文件擴展名。 這是TrID命令行及其結(jié)果(通過從命令提示符窗口復制/粘貼):

trid "d:\0tempd\40 character file name without extension"

trid“ d:\ 0tempd \ 40個字符文件名,不帶擴展名”

TrID/32 - File Identifier v2.20 - (C) 2003-15 By M.Pontello

TrID / 32-文件標識符v2.20-(C)2003-15通過M.Pontello

Definitions found: ?6019

找到的定義:6019

Analyzing...

分析...

Collecting data from file: d:\0tempd\40 character file name without extension

從文件收集數(shù)據(jù):d:\ 0tempd \ 40個字符文件名,不帶擴展名

100.0% (.PDF) Adobe Portable Document Format (5000/1)

100.0%(.PDF)Adobe可移植文檔格式(5000/1)

Here's the TrID GUI result:

這是TrID GUI結(jié)果:

Both TrID and TrIDNet easily determined that it is a PDF file — and with 100% certainty. Of course, 100% certainty is not always the case, as shown in this real-life example of a file uploaded in a recent EE question. The file bumped into the 40-character file name limit and wound up with a .x file extension. Here are the TrID results on it:

TrID和TrIDNet都可以輕松確定它是PDF文件,并且具有100%的確定性。 當然,并非總是100%的確定性,如在最近的EE問題中上傳的文件的真實示例所示。 該文件達到40個字符的文件名限制,并以.x文件擴展名結(jié)尾 。 這是TrID的結(jié)果:

TrID/32 - File Identifier v2.20 - (C) 2003-15 By M.Pontello

TrID / 32-文件標識符v2.20-(C)2003-15通過M.Pontello

Definitions found: ?6019

找到的定義:6019

Analyzing...

分析...

Collecting data from file: d:\0tempD\Time-Interval-Frequency-calculationv51.x

從文件收集數(shù)據(jù):d:\ 0tempD \ Time-Interval-Frequency-calculationv51.x

?51.3% (.XLSM) Excel Microsoft Office Open XML Format document (with Macro) (57500/1/12)

51.3%(.XLSM)Excel Microsoft Office Open XML格式文檔(帶有宏)(57500/1/12)

?45.0% (.XLSX) Excel Microsoft Office Open XML Format document (50500/1/11)

45.0%(.XLSX)Excel Microsoft Office Open XML格式文檔(50500/1/11)

? 3.5% (.ZIP) ZIP compressed archive (4000/1)

3.5%(.ZIP)ZIP壓縮存檔(4000/1)

It is, in fact, a .XLSM file, as predicted by TrID, although with only 51.3% certainty. After changing the file type from .x to .xlsm, it loaded perfectly into Excel.

實際上, 正如TrID預測的那樣,它是.XLSM文件,盡管只有51.3%的確定性。 將文件類型從.x更改為.xlsm之后 ,它完美地加載到Excel中。

If you find this article to be helpful, please click the thumbs-up icon below. This lets me know what is valuable for EE members and provides direction for future articles. Thanks very much! Regards, Joe

如果您發(fā)現(xiàn)本文有幫助,請單擊下面的大拇指圖標。 這使我知道什么對EE成員有價值,并為以后的文章提供了指導。 非常感謝! 問候喬

翻譯自: https://www.experts-exchange.com/articles/19759/How-to-determine-the-type-of-file-from-its-contents.html

無法確定本地文件類型

總結(jié)

以上是生活随笔為你收集整理的无法确定本地文件类型_如何从文件内容确定文件类型的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。