Run3 extract office text with pandoc
Extracts text from .docx and .pptx files using `pandoc`. This tool is preferred for its robustness in handling various document schemas and converting them into plain text for analysis.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run3_extract_office_text_with_pandocAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.8 KB, 134 tokens by cl100k_base, as published. Nobody here has run it
import subprocess
import shutil
def extract_office_text(file_path):
"""
Extracts text from docx or pptx files using pandoc.
"""
if not shutil.which("pandoc"):
return None
try:
# Convert to plain text
result = subprocess.run(
["pandoc", "-f", "docx" if file_path.endswith(".docx") else "pptx", "-t", "plain", file_path],
capture_output=True,
text=True,
check=True
)
return result.stdout
except subprocess.CalledProcessError:
return None
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.