# Metadata and columns

**URL:** https://resource.dopus.com/t/metadata-and-columns/26763
**Category:** Help & Support
**Created:** [September 1, 2017, 9:53pm UTC](https://resource.dopus.com/t/metadata-and-columns/26763 "2017-09-01T21:53:52Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![wowbagger](https://resource.dopus.com/user_avatar/resource.dopus.com/wowbagger/32/25880_2.png) [@wowbagger](https://resource.dopus.com/u/wowbagger)
#### Post date: [September 8, 2017, 3:32am UTC](https://resource.dopus.com/t/metadata-and-columns/26763/9 "2017-09-08T03:32:51Z")

</div>

This was further discussed in a private message, thought i would put the resolution back here in case others we interested.  
After installing the custom text columns addon mentioned above.

## Requirement 1:

Let’s say i want to extact these things from “Gotham - 1x01 - Le Regole Di Gotham”:  
1 - Gotham  
2 - Stagione 1, where “Stagione” is added manually by me and 1 is the 1x01 of the season

## Solution

```auto
{
  "columns": [
    {
      "name": "test-season",
      "label": "test-season",
      "header": "test-season",
      "type": "text",
      "defwidth": "20",
      "justify": "left",
      "infotiponly": false,
      "maxstars": "5",
      "datetimeformat": "yyyy-mm-dd",
      "noGroup": false,
      "grouporder": "",
      "sorting": "normal",
      "regexp": ".*\\s-\\s(\\d)x(\\d\\d).*",
      "inputItemProperty": "name_stem",
      "firstValid": false,
      "output": "Stagione $1",
      "filter": "all",
      "nogroup": false
    },
    {
      "name": "test-name",
      "label": "test-name",
      "header": "test-name",
      "type": "text",
      "defwidth": "20",
      "justify": "left",
      "infotiponly": false,
      "maxstars": "5",
      "datetimeformat": "yyyy-mm-dd",
      "noGroup": false,
      "grouporder": "",
      "sorting": "normal",
      "regexp": "(.*?)\\s-\\s.*",
      "inputItemProperty": "name_stem",
      "firstValid": false,
      "output": "$1",
      "filter": "all",
      "nogroup": false
    }
  ]
}

```

The dialog for the columns simply saves some config in to a global variable. You can replace all the column config with the config I sent above.

- Go here [Global Variable Management Dialog](https://resource.dopus.com/t/global-variable-management-dialog/26402) and grab the addon and install it.
- Open the Vars dialog
- Find the variable called **RegexpCustomColumnsConfig**
- Paste JSON in that the **value** section.

If you would rather make the custom columns with the dialog.  
**Column1:**  
Name: `Season`  
Regexp: `.*\s-\s(\d)x(\d\d).*`  
Output: `Stagione $1`

**Column2:**  
Name: `Name`  
Regexp: `(.*?)\s-\s.*`  
Output: `$1`

## Requirement 2:

- **Episode 001** , and you want **Episode** and **001**.
- **Name Surname - Episode 002** , and you want **Episode** and **002**.

## Solution

Notice there are multiple capture groups now.  
`^(.*?\s-\s)?(.*)\s(\d{1,3})$`  
Testing in expresso.

 ![image](https://resource.dopus.com/uploads/default/original/3X/3/1/315e3112901837d4a77bea03e6727fa44aac260e.png)

---

_[View the full topic](https://resource.dopus.com/t/metadata-and-columns/26763)._
