# Extract TVEPISODE & TVSEASON from FILENAME

**URL:** https://community.mp3tag.de/t/extract-tvepisode-tvseason-from-filename/49862
**Category:** General Discussion
**Created:** [August 9, 2020, 10:36am UTC](https://community.mp3tag.de/t/extract-tvepisode-tvseason-from-filename/49862 "2020-08-09T10:36:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![smugalugs](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@smugalugs](https://community.mp3tag.de/u/smugalugs)
#### Post date: [August 9, 2020, 10:36am UTC](https://community.mp3tag.de/t/extract-tvepisode-tvseason-from-filename/49862/1 "2020-08-09T10:36:06Z")

</div>

Using the extended tags I am tagging video for PLEX. I can manage to get Titles and year from my movies because they are simply named however my TV database is extensive and randomly named. How do I get the episode and season number from the file name to the TVEPISODE & TVSEASON tag?  
Filenames are formatted differently however episode and season are always formatted as follows (case varies upper and lower):

This Show S03E13 Maybe some other text.mkv (or other file type)  
this show - (2019) s02e09 - Maybe some numbers and letters.mkv

Regards

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [August 9, 2020, 11:32am UTC](https://community.mp3tag.de/t/extract-tvepisode-tvseason-from-filename/49862/2 "2020-08-09T11:32:39Z")

</div>

Perhaps like this (with Convert\>Filename-Tag):  
`%dummy% S%tvseason%E%tvepisode% %dummy%`
