Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

9 957 Posts in 5 431 Topics- by 1 216 Members - Latest Member: santini862

17 June 2019, 09:01
Select Language English | Russian ru | German
Main PageIRC Client KVIrc forumKVIrc discussionKVIrc scriptingHelp with Parsing A File Name
Pages: [1]
Print
Author Topic: Help with Parsing A File Name  (Read 1909 times)
0 Members and 1 Guest are viewing this topic.
tevi
Новичок
*

Репутация: 0
Posts: 1


View Profile
« on: 16 May 2016, 21:34 »

Most of my video files are names "fileName.S##E##.*.mkv". I found this grep command

%stuff = $str.grep("^(.*)[^a-zA-Z0-9]S[0-9]+[^a-zA-Z0-9]?E[0-9]+[^a-zA-Z0-9]",%testName,"rp")

that will extract the fileName part to %stuff[1], but I'm looking to also get the season and episode numbers. Currently I use the index location in the zeroth array like:

%season = $str.mid(%testName,$(%stuff[0]-6),2)
%episode = $str.mid(%testName,$(%stuff[0]-3),2)

According to https://github.com/kvirc/KVIrc/issues/1404 the "p" flag is depreciated. Is there a better way to get this information especially when I'm ls and have a folder full of file names?
« Last Edit: 16 May 2016, 21:54 by tevi » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic