NotebookCellData

NotebookCellData[]

returns data about the cells in the currently selected notebook.

NotebookCellData[nbobj]

returns data about the cells in the given NotebookObject.

NotebookCellData[{cellobj1,cellobj2,}]

returns data about each given CellObject.

NotebookCellData[objs,elems]

includes the given elements of data.

NotebookCellData[objs,elems,fmt]

returns data in the indicated format.

Details and Options

  • Supported elements include the name of any option to Cell, as a string or a symbol.
  • Elements can also include any key known to Developer`CellInformation, including "Style", "ContentData", "ContentDataForm", "FirstCellInGroup" and others.
  • Other supported elements include:
  • "CellExpressionByteCount"the ByteCount of the Cell expression
    "CellMemoryByteCount"the size in memory for the cell
    "CellContentMemoryByteCount"the size in memory for the cell content
    "CellWordCount"the number of words in the cell
    "CellImage"an image of the cell
    "CellRasterSize"the raster size of the cell, in pixels
    "CellThumbnail"a thumbnail of the cell
    "CellGroupParent"the CellObject of the cell's group parent, if any
    "CellGroupChildren"a list of the cell's group children
    "CellGroupDescendants"a list of the cell's group children at any depth
    "CellChangeCount"the number of change events stored for the cell
    "FirstChangeTime"the earliest recorded change time for the cell
    "LastChangeTime"the latest recorded change time for the cell
    "CellContainsDynamics"whether the cell contains explicit dynamic boxes
    "CellObject"the CellObject of the cell
    "CellExpression"the Cell expression of the cell
    "CellContents"the first argument of the Cell expression
    "CellStyle"a list of the cell's styles
    "CellOptions"the options of the Cell expression
  • When the "CellOptions" element is included, that will include columns for any options that are directly set for any cell in the target objects.
  • The default elems is Automatic, which includes "CellOptions", "CellMemoryByteCount", "CellGroupParent" and "CellGroupChildren".
  • Supported formats include:
  • Automaticreturn the data as a List, Association or Dataset, depending on elems
    "Association"return the data as an Association
    "Dataset"return the data as a Dataset
  • When elems is a single item, default formatting will return a raw list of data.
  • Any other elems setting will return a Dataset by default.
  • Column names will always be strings, even for elements specified as a symbol.
  • Row names are taken to be the corresponding CellObject expressions.

Examples

open allclose all

Basic Examples  (5)

Return data about cells in the current notebook:

Return data for the first few cells:

Return specific elements of data:

Return a list of values for a given data element:

Return data as an Association:

Scope  (2)

Get images for all "ExampleSection" cells in this notebook:

Get data about the 5 cells currently using the most memory in this notebook:

Applications  (1)

Visualize the editing times for a given notebook:

Neat Examples  (1)

Create a collage of images of this notebook's cells, where cells with a larger byte count appear larger:

Wolfram Research (2024), NotebookCellData, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookCellData.html.

Text

Wolfram Research (2024), NotebookCellData, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookCellData.html.

CMS

Wolfram Language. 2024. "NotebookCellData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NotebookCellData.html.

APA

Wolfram Language. (2024). NotebookCellData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookCellData.html

BibTeX

@misc{reference.wolfram_2024_notebookcelldata, author="Wolfram Research", title="{NotebookCellData}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookCellData.html}", note=[Accessed: 24-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_notebookcelldata, organization={Wolfram Research}, title={NotebookCellData}, year={2024}, url={https://reference.wolfram.com/language/ref/NotebookCellData.html}, note=[Accessed: 24-November-2024 ]}