




已阅读5页,还剩41页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
广西柳州畜牧兽医学校 梁桂 错误难免 以原文为准微软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记录构成,每个记录都有一个4字节的头,其中前两个字节是指定记录类型的操作码,后两个字节指定记录的长度。记录头中的数据值以低位到高位形式存储 。除了记录头以外的字节就是记录的数据(如图2-1 )Figure 2-1.BIFF record header. | 记录头 |记录体 字节编号 |0 1 2 3 |0 1 . -记录内容 | XX | XX | XX | XX | XX | XX | . - | 操作码 | 长度 | 数据 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代表一个十六进制数字。两个X组成一个字节。编号0、1字节是操作码。编号3、4字节是记录长度。 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记录。 |记录头|记录体| 字节| 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.排在前面的两个字节是BOF操作码,这里显示是09H 。接下来两个字节表明记录体是4字节长。记录体的头两 字节是版本号( 2是Excel的初始版本) 。后两个字节是文件类型。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.电子表格的数据记录单元格 电子表格在屏幕上显示或以矩阵形式打印出来,每栏的标识在其顶端,每行都有确定的编号。 因此,单元格A1在第一列和第一行。单元格C240在第3栏 和第240行。这种有规律的编排很容易理解。然而,这样的编排不利于电脑提高信息处理效率。电脑最好的处理方式是使用二进制数字。因此, Excel的存储单元标志使用二进制数字。人们可以把二进制数字理解为十六进制。在系统中第一个编号是 0 ,不是1 。 图2-3 ,显示了一个INTEGER record(整数形式记录),说明了存储的列 和行信息。 Figure 2-3.INTEGER record. 图2-3 。整数纪录。 |Record Header |Record Body|总记录头|记录机构字节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表示是一个整数记录。长度字节的记录表明记录体是9 字节长。记录体的第0行对应于电子表格1行。第1行对应 电子表格2行 ,依此类推。第2列相对于电子表格C列。因此,图2-3显示的单元格是C1 。接下来的三个字节,标示为“ rgbAttr (红绿蓝属性) ”指定单元格属性(如表2-3所示 ) 。最后的字节(标记“w” )是无符号整型值,这里是39H(16进制)或57(10进制)。因此,该记录确定单元格C1有一个整数值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电子表格文件在预定位置有各种类型记录。一个文件不需要所有类型记录,但每个记录都以相同的次序出现。表2-1按出现的顺序列出了Excel电子表格文件的记录类型,这些记录总会出现在BIFF文件中。表2-2按操作码次序列出了不同记录类型。BIFF文件不可缺少的记录类型有行,空白,整数,数量,标签,BOOLERR ,公式,默认栏,单元格内容。这些记录包含3字节的属性字段“ rgbAttr (红绿蓝属性)” 。下表描述了属性字段的比特与对应单元格属性的关系。 Table 2-1.Cell Attributes表2-1 。单元格属性Byte Offset Bit Description Contents字节偏移位 比特位 描述 比特内容 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(按出现顺序排列的excel记录类型)Record Type记录类型 Opcode (Hexadecimal)操作码(16进制)BOF(记录头) 09FILEPASS(文件密码) 2FINDEX(索引、目录) 0BCALCCOUNT(迭代计数) 0CCALCMODE(计算模型) 0DPRECISION(精确) 0EREFMODE(参考模式) 0FDELTA(第四位的) 10ITERATION(重复) 111904 22BACKUP(备份) 40PRINT ROW HEADERS(打印列标题) 2APRINT GRIDLINES打印网格线 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外部参考文件数 16EXTERNSHEET外部参考表格 17EXTERNNAME外部参考名称 23FORMATCOUNT格式计数 1FFORMAT格式 1ENAME名称 18DIMENSIONS尺寸 00COLUMN DEFAULT列预置 20ROW行 08BLANK空白 01INTEGER整数 02NUMBER数 03LABEL标签 04BOOLERR布尔 05FORMULA公式 06ARRAY阵列 21CONTINUE连接 3CSTRING字符串 07TABLE表 36TABLE2表2 37PROTECT保护 12WINDOW PROTECT视窗保护 19PASSWORD密码 13NOTE注意 1CWINDOW1视窗1 3DWINDOW2视窗2 3EPANE窗格 41SELECTION选择 1DEOF文件结尾 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.下面部分按照操作码顺序列出了所有的记录类型。并逐个字节列出每个记录的形式。请注意, 这里的Excel是指电子表格或工作表 。DIMENSIONS(尺寸) 00h 0dRecord Type(记录类型): DIMENSIONS(尺寸)Description(描述): Entire dimensions or range of a spreadsheet整个层面或范围的电子表格Record Body Length记录体长度: 8 bytes字节Record Body Byte Structure(结构): Byte Number字节编号 Byte Description字节描述 Contents (hex)内容 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无符号整数常量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数 03h 3dRecord Type: NUMBERDescription: Constant floating point number恒浮点数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) 浮点数值( IEEE格式,见附录A )LABEL表 04h 4dRecord Type: LABELDescription: Constant string常数字符串Record Body Length: 8 to 263 bytes 8至263字节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!数值 0Fh #REF!参考 17h #NAME?名字 1Dh #NUM!个数 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字节)必须设定。Recalc标志可以是任何非零值。但是,标志值是3表明该单元格是矩阵的一个组成部分,以及整个矩阵必须重新计算。714字节可以是一个数字,一个布尔值,错误代码,或者一个字符串。下面例子是具体的应用。Case 1案例1: Bytes 7 - 14 contain a Boolean value. 字节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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 IEC 61084-1:1991/AMD1:1993 EN-D Amendment 1 - Cable trunking and ducting systems for electrical installations - Part 1: General requirements
- 通管局考试试题及答案
- 测量初级考试试题及答案
- 智能驾校模拟考试试题及答案
- 华大基因面试题及答案
- 四川土壤试题及答案
- 军人专升本考试题及答案
- 断路作业考试题及答案
- 网购药材测试题及答案
- 慢性胃炎试题及答案
- 助产专业介绍
- 工程项目招投标流程及风险防控措施
- 《电机与拖动基础》课件(共十一章)
- 民宿合伙协议书范本
- 新学期教学工作会议上校长讲话:把功夫下在课堂里把心思放在学生上把质量落到细节中
- GB/T 2794-2022胶黏剂黏度的测定
- GB/T 41365-2022中药材种子(种苗)白术
- GB/T 31717-2015病媒生物综合管理技术规范环境治理蚊虫
- 水利工程设计变更表格
- 上海交通大学学生生存手册
- 收益还原法课件
评论
0/150
提交评论