How to extract dimensions from filenames and configuration names

You are here:

Lightning has a database to make searching lightning-fast. This database contains the dimensions and materials for all your fasteners.

To be able to use Lightning, you need to fill this database once. This takes 15-60 minutes, depending on the number of files and the naming scheme you used.

We go through the setup process in this video and we explain each step in this article. Because software changes faster than video, the video is always a bit behind. We’ll do our best to keep the Knowledge Base up to date.

Open the settings

Click Tools > Lightning > Settings

lightning open settings

Step 1 to 3

See Settings: each step explained.

Step 4: creating patterns

This is the interface for step 5 of the settings:

View image in new tab

1. What is a pattern?

Say a file name is ISO4014-M6x20-8.8-zinc and all other files in the folder follow the same structure.

We replace every word or number that varies in that folder with a tag. For example <diameter> or <length>. The tags are not case-sensitive and there are no closing brackets like with HTML or XML.

You can type this pattern manually or click the buttons you see above to add a tag. Then you click Apply pattern to selection to apply the new pattern to the selected folders, files, parts or configurations.

So for the filename above, the pattern you need is:


If you enter this correctly, Lightning will read the standard as ISO4014, the diameter as 6, et cetera.

A few examples

FilenameFilename patternConfiguration nameConfiguration name pattern
ISO 4014 M4x20<standard> M<diameter>x<length>Default
DIN123 – 5h6x50<standard> – <diameter><fit>x<length>Steel plain<material> <coating>
Bolt ISO 5 M4<ignore> <standard> <standard> M<diameter>20<length>

2. How to build a pattern

Data sources

There are four sources you can get fastener data from:

  1. File names
  2. Configuration names
  3. File-level custom properties
  4. Configuration-level custom properties

Available tags

  • <Standard>
  • <Diameter>
  • <Pitch>
  • <Length>
  • <Fit>
  • <Material>
  • <Coating>
  • <Ignore>
  • <OptionalOpen>
  • <OptionalClose>

Using two identical tags

We combine the values found for identical tags. You can, for example, you use <standard> <standard>to recognize ISO 4014, with a space in between. Usually, you only need one tag, though, even when there is a space between two words.

<Ignore> tag

Sometimes there is text in your filename that Lightning does not need. To skip over that text, you can use the <ignore> tag.

<OptionalOpen> and <OptionalClose> tags

Say your folder contains filenames with and without a pitch:

  • DIN929-M10-A2-50
  • DIN929-M10x1.25-A2-50

You can apply a single pattern for the entire folder by using <OptionalOpen> and <OptionalClose> tags. Everything in between these tags can be present but is not mandatory.

The pattern you need to recognize these two files is:


Lightning will find no value for the pitch for the first file and finds the pitch of 1.25 mm for the second file.

3. How to reuse previously created patterns

Chances are that many of your filenames follow only a few patterns. That’s why we store the patterns you created in this session. At the top, there is a radio button Previously used. Select that one to display your previous patterns and apply it to your selected files or folders.

View image in new tab

4. How to store patterns in text files

If you purchase fastener models from us, we include a file with Lightning settings in every folder. When this file is present, we can automate 95% of your setup process.

If you want to, you can create your own text files. There needs to be a file in each folder where there are part files. The text file tells Lightning:

  1. The fastener type
  2. The thread type
  3. The patterns for the file name and configuration name

You can read all about it in How to store patterns in text files.