Skip to content

Instantly share code, notes, and snippets.

View neilmcardle's full-sized avatar

neilmcardle neilmcardle

View GitHub Profile
@neilmcardle
neilmcardle / extract_svg_as_plain_text.py
Created April 29, 2025 11:15
Extract SVG code from files and save it as plain text using Python.
from pathlib import Path
# This script combines multiple SVG files into a single text file.
# It reads each SVG file and writes its content to 'combined_svgs.txt' with a header.
# Choose ONE of the options below to specify which SVG files to process.
# Option 1: Automatically process all .svg files in the script's directory
# - Place your SVG files in the same directory as this script.
# - The script will find and process all files with an .svg extension.
svg_dir = Path(".") # Current directory