1.1.6.2.  Article number search with regular expression

This example uses the following CSV file and is intended to provide an overview of the use of regular expressions.[4]

In the original state the manufacturer article number cannot be mapped on the corresponding one of the PARTsolutions catalog. Handicapping is the prefix "SK" before the manufacturer article number. The variance can simply be corrected by a regular expression, thus the automatic assignment can happen without problems then.

First test the existing file with the settings at Section 1.1.6.1, “ Article number search Standard procedure”. You only need to adjust the entry in the Product source [Product Source] node to the new file => No assignments are possible.

Now slightly modify the standard example:

  1. Call up the Available filters docking window in the context menu of the toolbar.

  2. Select the Regular expression filter.

  3. Drag & drop the filter onto the edge between the product source [Product Source] and item number Find filter [Find Article Number].

  4. Confirm in the Line settings [Pipe settings] dialog box by clicking OK.

    -> Now the filter is part of the pipeline.

  5. Select the filter.

    -> The settings dialog is displayed.

  6. Perform the settings for the regular expression:

    • Define Regular Expression: Enter the desired regular expression here.

      In the example in hand:

      (?:[^0-9]*)([0-9]+\.[0-9]+)

      With this expression you can remove any number of characters and empty spaces (everything except numbers) from a numerical sequence splitted by a dot.

      To test the effectiveness of the printout, enter a number under Input data and click on Test. If the expression is correct, the desired result is displayed under Result.

    • Case sensitivity: If the letter prefix would be case-sensitive, activate the checkbox.

    • Replace result from Regular Expression with:

    • Field selection -> Field for modification: Determine the field to be modified. Here in the example "Manufacturer article number".

    • Test: See above

    • Output -> Update modification field:

      • Checkbox is activated: The field specified under Field selection is overwritten. (As used here in the example.)

      • Checkbox deactivated: The output is written in the specified field, which would enable further operations based on this.

  7. Start the process.

  8. Open the product links under Workspace -> Catalogs -> <name of CSV catalog> -> Products.

    Since "SK" is removed by the regular expression, the link can be created.

    Since "SK" is removed by the regular expression, the link can be created.




[4] The example file used article_number_search_regexp.csvcan be found at "$CADENAS/training/partdatacenter/article_number_assignment".