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 4

See this article.

Step 5: creating patterns

This is the interface for step 5 of the settings:

View image in new tab

How to build 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.

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 <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.

How to get data from filenames or configuration name

In the window above, the left half is to extract data from filenames. The right half is for extracting data from configuration names.

Our great fastener library only has one configuration per file because this is faster and more stable, so in that case, you don’t need the right half of that window. There is a checkbox to hide/show this section.

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 filename pattern
  4. The configuration name pattern

You can read all about it here.