Illegal Characters When Using TV Show Feature

Advanced Renamer forum
#1 : 14/02-17 14:59
Kris
Kris
Posts: 6
I'm using the Import-->TV Show feature to rename TV shows. The rename pattern that I'm using is: <TVShow Title> - S<TVShow Season>E<TVShow EpisodeNumber> - <TVShow EpisodeTitle>

The problem is some of the episode names contain illegal characters - e.g. quotations (") and question mark (?). How do I handle these?

When I click "Start Batch" it pops up a dialog telling me that there are unsupported characters in the file name but the only options it provides is "Stop batch" and "Skip erroneous files". What I'd like is a method to remove the illegal characters.


Screenshot of illegal characters in interface:
https://snag.gy/SKb6cR.jpg

Screenshot of error when renaming:
https://snag.gy/MKgkxB.jpg


14/02-17 14:59
#2 : 14/02-17 21:12
G. Lambany
G. Lambany
Posts: 187
Reply to #1:
Maybe this method after the tv episode method?

method: remove pattern
pattern:["<>:\*\?]
use regular expression:checked


14/02-17 21:12
#3 : 16/02-17 23:02
Kris
Kris
Posts: 6
Reply to #2:

Thanks for the reply G. Lambany. I couldn't get the remove to work - pasting the regex into into either the "Remove count" or "Starting at" fields didn't seem to do anything. I did manage to get a replace working with the regular expression you gave though. Thanks for the help!


16/02-17 23:02
#4 : 17/02-17 00:19
G. Lambany
G. Lambany
Posts: 187
Reply to #3:
"remove pattern" is the method, not remove


17/02-17 00:19
#5 : 17/02-17 15:33
Mal
Mal
Posts: 5
Reply to #3:

Illegal (aka reserved or invalid) characters in filenames are a Windows issue and must be solved at the operating system level first. That's to say, Windows has to be happy with filenames before programs can handle them. Simply, no file can be handled/processed by Windows if it contains illegal filename characters. Illegal characters in Windows include / ? < > \ : * | " (as well as control-sequence characters) and must not be used, in fact Windows won't actually let you use them.

Many TVs, PVRs (Personal Video Recorders), etc. use 'kludged' filing systems that have no regard for Microsoft's Windows file-naming conventions thus they literally interpret a TV station's exact program name without having any regard to any character limitation imposed by Windows. (Naturally, this is never an issue when playing back a recording through the TV or PVR.)

A classic (and notorious example) of this problem is the name of Korean War sitcom M*A*S*H. The asterisks in the name mean that Windows cannot process it in any way – brain-dead Windows will not even let you rename it.

The easiest way around this Windows limitation is to use special renaming or rescue/recovery programs that can bypass the Windows interface and rename any such files. I use an old recovery program called DERescue but there are many others. For instance, if a USB thumb drive from my TV contained say a file with the illegal filename 'xyx-M*A*S*H.mts' then I'd tell DERescue to 'rescue' the contents of the drive, the file would then be copied to the PC hard drive as 'xyx-MASH.mts' which is a completely legit name.

(I might add that at this late juncture it is quite outrageous that Windows [and Linux] still have the ridiculous limitation whereby certain characters cannot be used in filenames. Any printable Unicode character ought to be able to be used in a filename whether it be an *, ? , : or even an Egyptian hieroglyph/cartouche for that matter—tell a traditional printer that he cannot use * or ? in a book title and he'd just laugh at you! Frankly, I'm just fed up not being able to use the question mark '?' in Windows filenames; having to continually type the Spanish '¿' [ALT 0191] as an alternative substitute is a real nuisance and it ought not be necessary.)




17/02-17 15:33 - edited 17/02-17 15:34
#6 : 19/02-17 12:07
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #1:
In the Settings window on the Rename tab you can set which character to use when Advanced Renamer tries to use a character not legal for filenames in some metadata. This replace character is only used for when extracting metadata, like EXIF, ID3 or similar. For some reason this technique wasn't used for TV Show import. In the next version, due in the next couple of days, this will be fixed so that the TV Show tags will replace these characters not legal for filenames. Usually these character are * : and ?.


19/02-17 12:07
#7 : 19/02-17 15:02
Kris
Kris
Posts: 6
Reply to #6:

Thanks for the replies everyone!

G. Lambany: Tried "Remove Pattern" instead of "Remove" - worked great.

Kim Jensen: Thanks - didn't know that there was a setting for that. Also good to know it will be extended to TV Show import with the next version. That will make it a lot easier for people.

Mal: Thanks for the info - the "Remove Pattern" is working for now but good to know that there are other solutions like DERescue out there.


19/02-17 15:02