酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

file-formats.md 5.9 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # File Formats
  2. PhpSpreadsheet can read a number of different spreadsheet and file
  3. formats, although not all features are supported by all of the readers.
  4. Check the [features cross
  5. reference](../references/features-cross-reference.md) for a list that
  6. identifies which features are supported by which readers.
  7. Currently, PhpSpreadsheet supports the following File Types for Reading:
  8. ### Xls
  9. The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary
  10. file format that was used by Microsoft Excel™ between versions 95 and 2003.
  11. The format is supported (to various extents) by most spreadsheet
  12. programs. BIFF files normally have an extension of .xls. Documentation
  13. describing the format can be [read online](https://msdn.microsoft.com/en-us/library/cc313154(v=office.12).aspx)
  14. or [downloaded as PDF](https://download.microsoft.com/download/2/4/8/24862317-78F0-4C4B-B355-C7B2C1D997DB/%5BMS-XLS%5D.pdf).
  15. ### Xml
  16. Microsoft Excel™ 2003 included options for a file format called
  17. SpreadsheetML. This file is a zipped XML document. It is not very
  18. common, but its core features are supported. Documentation for the
  19. format can be [read online](https://msdn.microsoft.com/en-us/library/aa140066(office.10).aspx)
  20. though it’s sadly rather sparse in its detail.
  21. ### Xlsx
  22. Microsoft Excel™ 2007 shipped with a new file format, namely Microsoft
  23. Office Open XML SpreadsheetML, and Excel 2010 extended this still
  24. further with its new features such as sparklines. These files typically
  25. have an extension of .xlsx. This format is based around a zipped
  26. collection of eXtensible Markup Language (XML) files. Microsoft Office
  27. Open XML SpreadsheetML is mostly standardized in [ECMA 376](https://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm)
  28. and ISO 29500.
  29. ### Ods
  30. aka Open Document Format (ODF) or OASIS, this is the OpenOffice.org XML
  31. file format for spreadsheets. It comprises a zip archive including
  32. several components all of which are text files, most of these with
  33. markup in the eXtensible Markup Language (XML). It is the standard file
  34. format for OpenOffice.org Calc and StarCalc, and files typically have an
  35. extension of .ods. The published specification for the file format is
  36. available from [the OASIS Open Office XML Format Technical Committee web
  37. page](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office).
  38. Other information is available from [the OpenOffice.org XML File Format
  39. web page](https://www.openoffice.org/xml/), part of the
  40. OpenOffice.org project.
  41. ### Slk
  42. This is the Microsoft Multiplan Symbolic Link Interchange (SYLK) file
  43. format. Multiplan was a predecessor to Microsoft Excel™. Files normally
  44. have an extension of .slk. While not common, there are still a few
  45. applications that generate SYLK files as a cross-platform option,
  46. because (despite being limited to a single worksheet) it is a simple
  47. format to implement, and supports some basic data and cell formatting
  48. options (unlike CSV files).
  49. ### Gnumeric
  50. The [Gnumeric file format](https://help.gnome.org/users/gnumeric/stable/sect-file-formats.html.en#file-format-gnumeric)
  51. is used by the Gnome Gnumeric spreadsheet
  52. application, and typically files have an extension of `.gnumeric`. The
  53. file contents are stored using eXtensible Markup Language (XML) markup,
  54. and the file is then compressed using the GNU project's gzip compression
  55. library.
  56. ### Csv
  57. Comma Separated Value (CSV) file format is a common structuring strategy
  58. for text format files. In CSV flies, each line in the file represents a
  59. row of data and (within each line of the file) the different data fields
  60. (or columns) are separated from one another using a comma (`,`). If a
  61. data field contains a comma, then it should be enclosed (typically in
  62. quotation marks (`"`). Sometimes tabs `\t`, or the pipe symbol (`|`), or a
  63. semi-colon (`;`) are used as separators instead of a comma, although
  64. other symbols can be used. Because CSV is a text-only format, it doesn't
  65. support any data formatting options.
  66. "CSV" is not a single, well-defined format (although see RFC 4180 for
  67. one definition that is commonly used). Rather, in practice the term
  68. "CSV" refers to any file that:
  69. - is plain text using a character set such as ASCII, Unicode, EBCDIC,
  70. or Shift JIS,
  71. - consists of records (typically one record per line),
  72. - with the records divided into fields separated by delimiters
  73. (typically a single reserved character such as comma, semicolon, or
  74. tab,
  75. - where every record has the same sequence of fields.
  76. Within these general constraints, many variations are in use. Therefore
  77. "CSV" files are not entirely portable. Nevertheless, the variations are
  78. fairly small, and many implementations allow users to glance at the file
  79. (which is feasible because it is plain text), and then specify the
  80. delimiter character(s), quoting rules, etc.
  81. **Warning:** Microsoft Excel™ will open .csv files, but depending on the
  82. system's regional settings, it may expect a semicolon as a separator
  83. instead of a comma, since in some languages the comma is used as the
  84. decimal separator. Also, many regional versions of Excel will not be
  85. able to deal with Unicode characters in a CSV file.
  86. ### Html
  87. HyperText Markup Language (HTML) is the main markup language for
  88. creating web pages and other information that can be displayed in a web
  89. browser. Files typically have an extension of .html or .htm. HTML markup
  90. provides a means to create structured documents by denoting structural
  91. semantics for text such as headings, paragraphs, lists, links, quotes
  92. and other items. Since 1996, the HTML specifications have been
  93. maintained, with input from commercial software vendors, by the World
  94. Wide Web Consortium (W3C). However, in 2000, HTML also became an
  95. international standard (ISO/IEC 15445:2000). HTML 4.01 was published in
  96. late 1999, with further errata published through 2001. In 2004
  97. development began on HTML5 in the Web Hypertext Application Technology
  98. Working Group (WHATWG), which became a joint deliverable with the W3C in
  99. 2008.