微軟Excel文件格式2.1(漢化對照).doc_第1頁
微軟Excel文件格式2.1(漢化對照).doc_第2頁
微軟Excel文件格式2.1(漢化對照).doc_第3頁
微軟Excel文件格式2.1(漢化對照).doc_第4頁
微軟Excel文件格式2.1(漢化對照).doc_第5頁
已閱讀5頁,還剩41頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

廣西柳州畜牧獸醫(yī)學校 梁桂 錯誤難免 以原文為準微軟Excel文件格式2.1(漢化對照)MICROSOFT EXCEL FILE FORMATMicrosoft Excel is a popular spreadsheet. It uses a file format called BIFF (BinaryFile Format). There are many types of BIFF records. Each has a 4 byte header. Thefirst two bytes are an opcode that specifies the record type. The second two bytesspecify record length. Header values are stored in byte-reversed form (less significantbyte first). The rest of the record is the data itself (Figure 2-1).Microsoft Excel是一種流行的電子表格。它使用的文件格式叫做BIFF (二進制 文件格式)。這種格式由許多類型的BIFF記錄構(gòu)成,每個記錄都有一個4字節(jié)的頭,其中前兩個字節(jié)是指定記錄類型的操作碼,后兩個字節(jié)指定記錄的長度。記錄頭中的數(shù)據(jù)值以低位到高位形式存儲 。除了記錄頭以外的字節(jié)就是記錄的數(shù)據(jù)(如圖2-1 )Figure 2-1.BIFF record header. | 記錄頭 |記錄體 字節(jié)編號 |0 1 2 3 |0 1 . -記錄內(nèi)容 | XX | XX | XX | XX | XX | XX | . - | 操作碼 | 長度 | 數(shù)據(jù) Each X represents a hexadecimal digitTwo Xs form a byte.The least significant (low) byte of the opcode is byte 0 and themost significant (high) byte is byte 1.Similarly, the low byte of the record lengthfield is byte 2 and the high byte is byte 3.每個X代表一個十六進制數(shù)字。兩個X組成一個字節(jié)。編號0、1字節(jié)是操作碼。編號3、4字節(jié)是記錄長度。 BOF (Beginning of File) 文件開頭。The first record in every spreadsheet is always of the BOF type (Figure 2-2).電子表格的第一個記錄總是BOF(圖 2-2)。圖 2-2.BOF record. |Record Header | Record Body |Byte |0 1 23 |0 1 2 3 | -Contents | 09 | 00 | 04 | 00 | 02 | 00 | 10 | 00 | - | opcode| length| version |file | | | | number |type|圖2-2 。BOF記錄。 |記錄頭|記錄體| 字節(jié)| 0 1 2 3 | 0 1 2 3 | - 目錄| 09 | 00 | 04 | 00 | 02 | 00 | 10 | 00 | - |操作碼|長度|版本|文件| | | |編號|類型| The first two bytes, arranged with the low byte first, show that the opcode for BOF is09h.The second two bytes indicate that the record body is 4 bytes long.The first twobytes of the body are the version number (2 for the initial version of Excel).The lasttwo bytes are the file type.Type 10h is a worksheet file.排在前面的兩個字節(jié)是BOF操作碼,這里顯示是09H 。接下來兩個字節(jié)表明記錄體是4字節(jié)長。記錄體的頭兩 字節(jié)是版本號( 2是Excel的初始版本) 。后兩個字節(jié)是文件類型。10h表示是電子表格文件。 Relating Spreadsheet Cells to Record Data BytesA spreadsheet appears on a screen or printout as a matrix of rectangular cells.Eachcolumn is identified by a letter at its top, and each row is identified by a number.Thus cell A1 is in the first column and the first row.Cell C240 is in the third columnand the 240th row.This scheme identifies cells in a way easily understood by people.However, it is not particularly convenient for computers, as they do not handle lettersefficiently.They are best at dealing with binary numbers.Thus, Excel stores cellidentifiers as binary numbers, that people can read as hexadecimal.The first number inthe system is 0 rather than 1.Figure 2-3, which shows the form of an INTEGER record, illustrates the storage of columnand row information.電子表格的數(shù)據(jù)記錄單元格 電子表格在屏幕上顯示或以矩陣形式打印出來,每欄的標識在其頂端,每行都有確定的編號。 因此,單元格A1在第一列和第一行。單元格C240在第3欄 和第240行。這種有規(guī)律的編排很容易理解。然而,這樣的編排不利于電腦提高信息處理效率。電腦最好的處理方式是使用二進制數(shù)字。因此, Excel的存儲單元標志使用二進制數(shù)字。人們可以把二進制數(shù)字理解為十六進制。在系統(tǒng)中第一個編號是 0 ,不是1 。 圖2-3 ,顯示了一個INTEGER record(整數(shù)形式記錄),說明了存儲的列 和行信息。 Figure 2-3.INTEGER record. 圖2-3 。整數(shù)紀錄。 |Record Header |Record Body|總記錄頭|記錄機構(gòu)字節(jié)Byte|0 1 2 3 |0 1 2 3 4 5 6 7 8 | -值Value | 02 | 00 | 09 | 00 | 00 | 00 | 02 | 00 | 00 | 00 | 00 | 39 | 00 | - | opcode| length| row | column| rgbAttr | w |操作碼|長度|行|列| rgbAttr |寬| Opcode 2 indicates an integer record.The length bytes show that the record body is 9bytes long.Row 0 in the body corresponds to spreadsheet row 1.Row 1 corresponds tospreadsheet row 2, and so on.Column 2 corresponds to spreadsheet column C.Thus,Figure 2-3 deals with cell C1.The next three bytes, labeled rgbAttr, specify cellattributes (Table 2-3).The final pair of bytes, (labeled w) holds the integersvalue.Here it is 39H or 57 decimal.Thus the record specifies that cell C1 of thespreadsheet contains an integer with the value 57.操作碼2表示是一個整數(shù)記錄。長度字節(jié)的記錄表明記錄體是9 字節(jié)長。記錄體的第0行對應于電子表格1行。第1行對應 電子表格2行 ,依此類推。第2列相對于電子表格C列。因此,圖2-3顯示的單元格是C1 。接下來的三個字節(jié),標示為“ rgbAttr (紅綠藍屬性) ”指定單元格屬性(如表2-3所示 ) 。最后的字節(jié)(標記“w” )是無符號整型值,這里是39H(16進制)或57(10進制)。因此,該記錄確定單元格C1有一個整數(shù)值57 。 Standard File Record OrderExcel worksheet files have each record type in a predetermined position.A file neednot have all types, but the ones that are present are always be in the same order.Table 2-1 lists the record types for Excel document (spreadsheet) files, in the orderthey would appear in a BIFF file.Table 2-2 lists the types in opcode order.Several record types in a BIFF file, namely, ROW, BLANK, INTEGER, NUMBER, LABEL,BOOLERR, FORMULA, and COLUMN DEFAULT, describe the contents of a cell.These recordscontain a 3 byte attribute field labeled rgbAttr.The following table describes howthebits in the field correspond to cell attributes.標準文件記錄次序 Excel電子表格文件在預定位置有各種類型記錄。一個文件不需要所有類型記錄,但每個記錄都以相同的次序出現(xiàn)。表2-1按出現(xiàn)的順序列出了Excel電子表格文件的記錄類型,這些記錄總會出現(xiàn)在BIFF文件中。表2-2按操作碼次序列出了不同記錄類型。BIFF文件不可缺少的記錄類型有行,空白,整數(shù),數(shù)量,標簽,BOOLERR ,公式,默認欄,單元格內(nèi)容。這些記錄包含3字節(jié)的屬性字段“ rgbAttr (紅綠藍屬性)” 。下表描述了屬性字段的比特與對應單元格屬性的關(guān)系。 Table 2-1.Cell Attributes表2-1 。單元格屬性Byte Offset Bit Description Contents字節(jié)偏移位 比特位 描述 比特內(nèi)容 0 7 Cell is not hidden(單元格不隱藏) 0b Cell is hidden(單元格隱藏) 1b 6 Cell is not locked(單元格不鎖定) 0b Cell is locked(單元格鎖定) 1b 5-0 Reserved(保留), must be 0(必需是0) 000000b 7-6 Font number (4 possible)字體編號(4種可能) 5-0 Cell format code單元格格式代碼 2 7 Cell is not shaded(單元格沒有陰影、色彩) 0b Cell is shaded(單元格有陰影、色彩) 1b 6 Cell has no bottom border(單元格沒有底部邊界) 0b Cell has a bottom border(單元格有底部邊界) 1b 5 Cell has no top border(單元格沒有頂部邊界) 0b Cell has a top border (單元格有頂部邊界)1b 4 Cell has no right border(單元格沒有右邊界) 0b Cell has a right border(單元格有右邊界) 1b 3 Cell has no left border(單元格沒有左邊界) 0b Cell has a left border(單元格有左邊界) 1b 2-0 Cell alignment code 單元格排列代碼 general一般 000b left左 001b center中 010b right右 011b fill填滿 100b Multiplan default align.多平面默認排列 111bThe font number field is a zero-based index into the documents table of fonts.thecell format code is a zero-based index into the documents table of picture formats.There are 21 different standard formats.Additional custom formats may be defined bythe user.See the FONT and FORMAT record descriptions form additonal details.字體編號域是文檔字體表的基本索引。單元格格式代碼是文檔圖片格式的基本索引。加上用戶自定義的格式有21個不同的標準格式。以下為字體和格式記錄的具體描述。 Table 2-2.Excel Record Type in Order of Appearance(按出現(xiàn)順序排列的excel記錄類型)Record Type記錄類型 Opcode (Hexadecimal)操作碼(16進制)BOF(記錄頭) 09FILEPASS(文件密碼) 2FINDEX(索引、目錄) 0BCALCCOUNT(迭代計數(shù)) 0CCALCMODE(計算模型) 0DPRECISION(精確) 0EREFMODE(參考模式) 0FDELTA(第四位的) 10ITERATION(重復) 111904 22BACKUP(備份) 40PRINT ROW HEADERS(打印列標題) 2APRINT GRIDLINES打印網(wǎng)格線 2BHORIZONTAL PAGE BREAKS水平分頁符 1BVERTICAL PAGE BREAKS垂直分頁符 1ADEFAULT ROW HEIGHT默認行高 25FONT字體 31FONT2字體2 32HEADER頭 14FOOTER頁腳 15LEFT MARGIN左邊距 26RIGHT MARGIN右邊距 27TOP MARGIN上邊距 28BOTTOM MARGIN下邊距 29COLWIDTH(col寬) 24EXTERNCOUNT外部參考文件數(shù) 16EXTERNSHEET外部參考表格 17EXTERNNAME外部參考名稱 23FORMATCOUNT格式計數(shù) 1FFORMAT格式 1ENAME名稱 18DIMENSIONS尺寸 00COLUMN DEFAULT列預置 20ROW行 08BLANK空白 01INTEGER整數(shù) 02NUMBER數(shù) 03LABEL標簽 04BOOLERR布爾 05FORMULA公式 06ARRAY陣列 21CONTINUE連接 3CSTRING字符串 07TABLE表 36TABLE2表2 37PROTECT保護 12WINDOW PROTECT視窗保護 19PASSWORD密碼 13NOTE注意 1CWINDOW1視窗1 3DWINDOW2視窗2 3EPANE窗格 41SELECTION選擇 1DEOF文件結(jié)尾 0ATable 2-3.Excel Record Types in Opcode Order 表2-3,按照操作碼順序排列的Excel記錄(譯文參考表2-2)Record Type Opcode (hexadecimal)DIMENSIONS 00BLANK 01INTEGER 02NUMBER 03LABEL 04BOOLERR 05FORMULA 06STRING 07ROW 08BOF 09EOF 0AINDEX 0BCALCCOUNT 0CCALCMODE 0DPRECISION 0EREFMODE 0FDELTA 10ITERATION 11PROTECT 12PASSWORD 13HEADER 14FOOTER15EXTERNCOUNT 16EXTERNSHEET 17NAME 18WINDOW PROTECT 19VERTICAL PAGE BREAKS 1AHORIZONTAL PAGE BREAKS 1BNOTE 1CSELECTION 1DFORMAT 1EFORMATCOUNT 1FCOLUMN DEFAULT 20ARRAY 211904 22EXTERNNAME 23COLWIDTH 24DEFAULT ROW HEIGHT 25LEFT MARGIN 26RIGHT MARGIN 27TOP MARGIN 28BOTTOM MARGIN 29PRINT ROW HEADERS 2APRINT GRIDLINES 2BFILEPASS 2FFONT 31FONT2 32TABLE 36TABLE2 37CONTINUE 3CWINDOW1 3DWINDOW2 3EBACKUP 40PANE 41Worksheet Record Types in Opcode Order按照操作碼順序的工作表記錄類型The following section lists all record types in opcode order.It gives a specificationand byte-by-byte breakdown of each type.Note that Excel terminology refers tospreadsheets or worksheets as documents.下面部分按照操作碼順序列出了所有的記錄類型。并逐個字節(jié)列出每個記錄的形式。請注意, 這里的Excel是指電子表格或工作表 。DIMENSIONS(尺寸) 00h 0dRecord Type(記錄類型): DIMENSIONS(尺寸)Description(描述): Entire dimensions or range of a spreadsheet整個層面或范圍的電子表格Record Body Length記錄體長度: 8 bytes字節(jié)Record Body Byte Structure(結(jié)構(gòu)): Byte Number字節(jié)編號 Byte Description字節(jié)描述 Contents (hex)內(nèi)容 0-1 First row首行 2-3 Last row plus 1最后行加1 4-5 First column首列 6-7 Last column plus 1最后列加1Note: The last row and column in the record are both one greater than the highestnumbered occupied ones. 注:在記錄中最后一行和列的編號都大于實際占用的行和列的編號。BLANK空白 01h 1dRecord Type: BLANKDescription: Cell with no formula or value沒有公式或價值的單元格Record Body Length: 7 bytesRecord Body Byte Structure: Byte Number Byte Description Contents (hex) 0-1 Row 2-3 Column 4-6 Cell attributes (rgbAttr) (Table 2-3)單元格屬性(紅綠藍屬性)INTEGER 02h 2dRecord Type: INTEGER整型Description: Constant unsigned integer無符號整數(shù)常量Record Body Length: 9 bytesRecord Body Byte Structure: Byte Number Byte Description Contents (hex) 0-1 Row 2-3 Column 4-6 Cell attributes (rgbAttr) (Table 2-3) 單元格屬性(紅綠藍屬性) 7-8 Unsigned integer value (w) 無符號整型值(寬)NUMBER數(shù) 03h 3dRecord Type: NUMBERDescription: Constant floating point number恒浮點數(shù)Record Body Length: 15 bytesRecord Body Byte Structure: Byte Number Byte Description Contents (hex) 0-1 Row 2-3 Column 4-6 Cell attributes (rgbAttr) (Table 2-3) 7-14 Floating point number value (IEEE format, see Appendix A) 浮點數(shù)值( IEEE格式,見附錄A )LABEL表 04h 4dRecord Type: LABELDescription: Constant string常數(shù)字符串Record Body Length: 8 to 263 bytes 8至263字節(jié)Record Body Byte Structure: Byte Number Byte Description Contents (hex) 0-1 Row 2-3 Column 4-6 Cell attributes (rgbAttr) (Table 2-3) 7 Length of string字符串長度BOOLERR布爾常量或錯誤值 05h 5dRecord Type: BOOLERR布爾常量或錯誤值Description: Boolean constant or error value布爾常量或錯誤值Record Body Length: 9 bytesRecord Body Byte Structure: Byte Number Byte Description Contents (hex) 0-1 Row 2-3 Column 4-6 Cell attributes (rgbAttr) (Table 2-3) 7 Boolean or error value 布爾常量或錯誤值 Boolean布爾常量 true真 1 false假 0 Error錯誤值 #NULL!空 0 #DIV/0!除0 7 #VALUE!數(shù)值 0Fh #REF!參考 17h #NAME?名字 1Dh #NUM!個數(shù) 24h #N/A不適用的 2Ah 8 Specifies Boolean or error指定布爾或錯誤 Boolean布爾 0 Error錯誤 1FORMULA公式 06h 6dRecord Type: FORMULA公式Description: Name, size, and contents of a formula cell名稱,大小和單元格公式Record Body Length: 17-272 bytesRecord Body Byte Structure: Byte Number Byte Description Contents (hex) 0-1 Row 2-3 Column 4-6 Cell attributes (rgbAttr) (see Table 2-3) 7 Current value of formula (IEEE format, see Appendix A) 15 Recalc flag (Recalc標志) 16 Length of parsed expression解析表達式的長度 17 Parsed expression解析表達式If a formula must be recalculated whenever it is loaded, the recalc flag (byte 15) mustbe set.Any nonzero value is a set recalc flag.However, a flag value of 3 indicatesthat the cell is a part of a matrix, and the entire matrix must be recalculated. Bytes 7through 14 may contain a number, a Boolean value, an error code, or a string.Thefollowing tables apply.如果一個公式必須重新計算時, recalc標志( 15字節(jié))必須設(shè)定。Recalc標志可以是任何非零值。但是,標志值是3表明該單元格是矩陣的一個組成部分,以及整個矩陣必須重新計算。714字節(jié)可以是一個數(shù)字,一個布爾值,錯誤代碼,或者一個字符串。下面例子是具體的應用。Case 1案例1: Bytes 7 - 14 contain a Boolean value. 字節(jié)7 - 14包含一個布爾值。 Byte Number Byte Description Contents (hex) 7 otBool布爾 1 8 Reserved保留 0 9 Boolean value布爾值 10-12 Reserved保留 0 13-14 fExprO FFFFhCase 2: Bytes 7 - 14 contain an error code. Byte Number Byte Description Contents (hex) 7 otErr錯誤 2 8 Reserved保留 0 9 error code錯誤代碼 10-12 Reserved保留 0 13-14 fExprO FFFFhCase 3: Bytes 7 - 14 contain a string. Byte Number Byte DescriptionC

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論