How to import hundreds of *.kicad_sym into one library

Hi,
I downloaded a repository containing several hundreds of single *.kicad_sym files. e.g.(public · master · Lutz Müller / KiCad für Elektrotechnik · GitLab)
Now I don’t know how to import them all into one “library folder”.
Following the documentation Schematic Editor | 8.0 | English | Documentation | KiCad each symbol gets an extra item, which makes the exisiting KiCad library basically unusable. I’d like to join them all into one “folder” or maybe *.kicad_sym. What is the prefered way to do this? What documentation did I miss out ?

Thank you so much

K

Each symbol library is a file. Each .kicad_sym file in that repository is also a library. Look inside one of those files:

(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor)
  (symbol "NH fuse" (pin_numbers hide) (pin_names (offset 0) hide) (in_bom no) (on_board no)
...
)

You can strip off the first and the last line from each .kicad_sym file, concatenate them together and add the first and the last line to the result. There you will have all the symbols in one library file.

Creating one library for one directory in the that repository can be as simple as


for file in *.kicad_sym; do tail -n +2 "$file" | head -n -1 >> combined; done

if you have unix-style shell command line and have downloaded a directory from the repository. (Rename the “combined” file afterwards; if you create it as .kicad_sym in the midst of the script it will concatenate itself.)

Linux on Windows wsl will do the job. Probably Windows has its own command line tools which could do this, but I don’t know about them.

2 Likes