Package {parcxl}


Title: Fast Formula Stripping and Exporting Excel Sheets to Separate Files
Version: 0.1.0
Description: Provides fast, dependency-minimal tools to strip all cell formulas from standard Excel (.xlsx) files while preserving evaluated calculated values intact. It also supports exporting multi-sheet workbooks into standalone single-sheet files. By design, the package extracts only cell values and their formatting (styles) to ensure maximum speed and safety, discarding complex embedded objects such as images or charts.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: xml2, zip
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-06-27 05:44:31 UTC; HOMMA
Author: Shunsuke Homma [aut, cre]
Maintainer: Shunsuke Homma <shunsuke.homma@proton.me>
Repository: CRAN
Date/Publication: 2026-07-02 19:00:02 UTC

Core Logic to Filter and Extract Sheet Components Into Isolated Workbooks

Description

Maps cell-level content nodes (sheetData) directly into pristine standalone single-sheet templates, avoiding structural metadata conflicts.

Usage

core_export_sheets(temp_dir, output_dir)

Arguments

temp_dir

Character scalar. Path to the extracted OpenXML temporary directory.

output_dir

Character scalar. Path to the destination directory for outputting individual files.


Core Logic to Strip Formulas with Data Integrity

Description

Parses worksheet XML files, removes the ⁠<f>⁠ formula nodes while keeping the evaluated ⁠<v>⁠ nodes intact, and cleans up calculation chain references.

Usage

core_remove_formula(temp_dir)

Arguments

temp_dir

Character scalar. Path to the extracted OpenXML temporary directory.


Escape Special Characters for XML Text and Attributes

Description

Manually encodes XML standard entities to prevent breaking the XML structure.

Usage

escape_xml_string(string)

Arguments

string

Character vector to be escaped.

Value

Character vector with escaped XML entities.


Export an Excel File into Separate Value-Only Sheets

Description

Deconstructs a multi-sheet .xlsx file, flattens all internal cell formulas into values, and pipes each sheet layout out into clean, standalone, single-sheet Excel files.

Usage

export_sheets(input_xlsx, output_dir)

Arguments

input_xlsx

Character scalar. Path to the source multi-sheet .xlsx file.

output_dir

Character scalar. Path to the destination directory where separated files will be written.

Value

Invisible NULL.


Remove Formulas from an Excel File

Description

Extracts an .xlsx archive, drops all formula nodes while keeping the current calculated values intact, and saves the output as a streamlined, value-only workbook.

Usage

remove_formula(input_xlsx, output_xlsx)

Arguments

input_xlsx

Character scalar. Path to the source .xlsx file.

output_xlsx

Character scalar. Path where the flattened .xlsx file should be written.

Value

Invisible NULL.


Validate File Extension

Description

Checks if the input file path has a valid .xlsx extension.

Usage

validate_xlsx_ext(file_path)

Arguments

file_path

Character scalar. Path to the file.

Value

Invisible NULL. Throws an error if invalid.


ZIP Wrapper for Excel OpenXML Manipulation

Description

Unzips an Excel file into a temporary directory, executes a core logic function, and optionally recompresses the directory back into an .xlsx file.

Usage

with_zip_wrapper(input_xlsx, output_xlsx = NULL, core_func, ...)

Arguments

input_xlsx

Character scalar. Path to the input .xlsx file.

output_xlsx

Character scalar or NULL. Path to save the processed .xlsx file. If NULL, automatic recompression is skipped.

core_func

Function. A callback function that takes temp_dir as its first argument.

...

Additional arguments passed onto core_func.

Value

Invisible result of core_func.


Generate a Pristine, Single-Sheet OpenXML Structural Template

Description

Constructs minimal, standards-compliant workbook components optimized for cross-platform UTF-8 encoding.

Usage

write_minimal_template(target_dir, sheet_name, has_shared_strings, has_theme)

Arguments

target_dir

Character scalar. Directory path to generate the skeleton.

sheet_name

Character scalar. Visible name assigned to the single worksheet.

has_shared_strings

Logical. If TRUE, creates mapping declarations for text lookup.

has_theme

Logical. If TRUE, creates configuration paths for layout styling.