From 79f36fc7742b977f1412e956c677adbb681ece53 Mon Sep 17 00:00:00 2001 From: dat972 Date: Mon, 24 Aug 2026 23:14:56 -0500 Subject: [PATCH] we handled the '/' character in reorganize. Filecabinet converts it to a '-' so we are now processing that. The folder templates file still should match exactly how it looks in FCCS --- README.md | 2 +- fccs_config.py | 6 ++++++ fccs_folders.template.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3a97f4..125d81b 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Extracts and organizes documents from FileCabinet CS (Thomson Reuters) using GUI ## Setup Per Engagement 1. Edit `config.ini` -- point `backup_dir`, `export_dir`, and `output_dir` at the client's directories. This file is created automatically from `config.template.ini` the first time you run any script (it's git-ignored, so your machine-specific paths never drift the repo). To reset a machine, delete `config.ini` and re-run. Keep shared/default changes in `config.template.ini` (the tracked file). -2. Populate `fccs_folders.txt` -- open FCCS > System Configuration > Document Folders and list each folder template exactly as shown, one per line. Keep the `YYYY` prefix on recurring folders. Thomson Reuters product folders (UltraTax CS, Planner CS, Practice CS) are detected automatically and do not need to be listed. Like `config.ini`, this file is auto-created from `fccs_folders.template.txt` on first use and is git-ignored — edit it freely per engagement; put only broadly-useful defaults in the tracked template. +2. Populate `fccs_folders.txt` -- open FCCS > System Configuration > Document Folders and list each folder template exactly as shown, one per line (names containing `/`, like `Foreign Bank/Income`, can be copied verbatim — the code converts `/` to `-` automatically, matching how FCCS writes it into filenames). Keep the `YYYY` prefix on recurring folders. Thomson Reuters product folders (UltraTax CS, Planner CS, Practice CS) are detected automatically and do not need to be listed. Like `config.ini`, this file is auto-created from `fccs_folders.template.txt` on first use and is git-ignored — edit it freely per engagement; put only broadly-useful defaults in the tracked template. ## Workflow diff --git a/fccs_config.py b/fccs_config.py index fe5c57a..9e46049 100644 --- a/fccs_config.py +++ b/fccs_config.py @@ -139,6 +139,12 @@ def build_folder_patterns(templates): )) for tmpl in templates: + # FCCS converts "/" to "-" when embedding the folder name in the flat + # export filename ("/" is illegal in Windows filenames), so templates + # copied verbatim from the FCCS UI (e.g. "YYYY Foreign Bank/Income") + # must be normalized the same way to match — and to be usable as an + # output directory component. + tmpl = tmpl.replace("/", "-") if "YYYY" in tmpl: # Replace YYYY with captured 4-digit year pattern, escape the rest parts = tmpl.split("YYYY") diff --git a/fccs_folders.template.txt b/fccs_folders.template.txt index 757927b..f6d5171 100644 --- a/fccs_folders.template.txt +++ b/fccs_folders.template.txt @@ -6,6 +6,8 @@ # # List folder names exactly as shown in FCCS System Configuration > Document Folders. # Keep the YYYY prefix for recurring folders. Non-recurring folders go as-is. +# Names containing "/" (e.g. "YYYY Foreign Bank/Income") can be copied verbatim — +# the code converts "/" to "-" automatically, matching how FCCS writes filenames. # Thomson Reuters product folders (UltraTax CS, Planner CS, Practice CS) are # handled automatically — do not list them here. # Blank lines and lines starting with # are ignored.