List subdirectory + pedigree name

If you also wanted to know in which subdirectory the different pedigrees were located, here’s the DOS one-liner. Have fun.
echo.&echo subdirectory pedigree&echo ------------ ------------&for /f "tokens=1,9 delims=?\" %N in ('^(for /f %a in ^('dir /s /b %APPDATA%\gramps\grampsdb\name.txt'^) do @for /f %b in ^(%a^) do @echo %b?%a^) ^| sort') do @echo \%O\ %N

Slightly different the command in a batch file
@echo off&echo.&echo subdirectory pedigree&echo ------------ ------------&for /f "tokens=1,9 delims=?\" %%N in ('^(for /f %%a in ^('dir /s /b %APPDATA%\gramps\grampsdb\name.txt'^) do @for /f %%b in ^(%%a^) do @echo %%b?%%a^) ^| sort') do echo \%%O\ %%N

Example of the sorted output (sorted by pedigree name)

subdirectory pedigree
------------ ------------
\664b2fe6\   adobe
\664b3003\   Family 1
\664b2ffb\   Family2
\66a09d37\   PedigreeA
\664b2ff4\   Stammbaum

Sorry, don’t currently have a bash equivalent.

GRAMPS: AIO64-5.2.2-r1-f905d14, Python: 3.11.8, BSDDB: 6.2.9 (6, 0, 30), sqlite: 3.45.2 (2.6.0), LANG: de_AT.UTF-8, Betriebssystem: Windows

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.