Patent ID: 9690788
Date: 2017-06-27
CPC Classifications: G06F

Claim:
1. A method for file type identifying and analyzing, used for identifying a type of file read from a database and making an analysis, the method comprising: a loading step for loading file types and parameters of file formats into a memory; a file reading step for reading a file from the memory; a file type identifying step for determining whether the read file is of one of the file types that are identifiable for the memory; a step of determining whether the read file is a large file, wherein the read file is determined to be the large file when the read file exceeds a first designated number of bytes of information; a file analyzing step for analyzing the read file and generating an analysis report when the read file is determined to be of one of the file types that are identifiable for the memory, wherein the file analyzing step is conducted independently for each page of the read file when the read file is determined to be the large file, wherein each page of the read file corresponds to a second designated number of bytes of the read file into which the read file is divisible; wherein a line length, a field divider, a terminator, and a field string format are determined according to different rules for different types of files in the file analyzing step; and wherein, the file analyzing step further comprises: opening the read file, reading content of a designated byte size from the read file, lining up the read content according to a designated number of characters, and loading the lined up content into the memory; fetching the content in the first line of the read file in the memory, and for a first three characters of the content, searching the file formats from the memory according to the file type and a record type code; dividing data of said file format; dividing the first three characters for the remaining file content of the line after a segment number of said record type code is divided, searching file formats in combination with file type, and dividing the data for the file formats until reading of the designated bytes of file content is completed; and displaying the file content with an interface.