Summarize files to one file for AI analysis. (Script)

Burntz

Chieftain
Joined
Feb 15, 2025
Messages
15
Version: 1.0
Created: 2025-03-01
📜 File Summarization Script 📜
--------------------------------
This script searches for all files of a specified extension within the script's directory (and its subdirectories),
logs all found files (even empty ones) into a summary file, and combines the content of non-empty files into a single
output file. By default, both the summary and combined files are stored in the same directory as the script.
Command-line options allow customization of the search path, output directory, output filename, file extension, and
exclusions. If no arguments are provided, the script runs in interactive mode.

I created this script to analyze game files more efficiently with AI models to make mods.

The archive contains two files:
Windows: Generate_Summary.ps1 ( powershell script tested in windows 11 )
Windows / Mac / Linux: Generate_Summary.py ( python file tested in windows 11 and Ubuntu WSL2 python ver 3.12.9)

Example usage:
1. Extract files to the Civ7 installation directory like "C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VII"
2. Run either the .ps1 powershell script or the .py python script and follow prompt:
- For file type write .js or .xml or .sql etc... and press Enter
- Type exclusions if any and press Enter
- When asked to confirm directory type y and press enter
3. The file is generated to the same directory as the script.
4. Analyze the file with your buddies or with your favourite AI
5. Read the file help for additional functionality

https://forums.civfanatics.com/resources/summarize-files-to-one-file-for-ai-analysis.32004/

 
Back
Top Bottom