Invalid Identifier issue

Support for Windows users
Post Reply
karanrajpal14
Posts: 23
Joined: 03 May 2015, 16:21

Invalid Identifier issue

Post by karanrajpal14 »

Hello,

I've been facing an issue since yesterday. Whenever I try to run my script, I get an invalid identifier error. I did check the script for spaces in between seriesFormat and = and there weren't any. I've attached my script and a log as well. Please help me out.

Script:

Code: Select all

filebot -script fn:amc --action move --conflict skip -non-strict --log-file "D:\filebotScript\filebotMediaRenameBatch\TV\amcTV.log" "D:\filebotScript\tvInput" --def @D:\filebotScript\filebotMediaRenameBatch\TV\amcArgsTV.txt
Args:

Code: Select all

seriesFormat=D:\filebotScript\renamed\{n.replaceTrailingBrackets().sortName().upperInitial().space(' ').replaceAll(/\b[IiVvXx]+\b/, { it.upper() })} ({y})/{episode.special ? 'Special' : 'Season '+s}/{n.sortName().upperInitial().replaceTrailingBrackets().space(' ').replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} - {episode.special ? 'S00E'+special.pad(2) : s00e00.lower()} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'") .lowerTrail().replacePart(', Part $1').replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() }).replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)}{'.'+lang} [{vf} {vc.replace('HEVC','x265').replace('X265','x265')} {ac} {af.replace('8ch','7.1').replace('7ch','7.1').replace('6ch','5.1').replace('5ch','5.1').replace('3ch','2.1').replace('2ch','2.1')}]
unsorted=y
artwork=y
subtitles=en
storeReport=y
reportError=y
deleteAfterExtract=y
clean=y
plex=localhost:RzwxzAjtNXdnGTkcNB2k
ut_label=Series
Error:

Code: Select all

"seriesFormat" is not a valid identifier
Any help would be appreciated. Thank you!
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Invalid Identifier issue

Post by rednoah »

DO NOT use Microsoft tools for editing text files. In this case, your tool added a UTF-8 BOM (a invisible character) at the beginning of the file.

On Windows, you must use CP1252 encoding without BOM.

Both points are is explicitly mentioned in the documentation:
rednoah wrote:Notes:
  • Argument files must not contain byte order marks (i.e. do not use Microsoft tools for editing text files)
  • Argument files are read with the default encoding (i.e. CP1252 on Windows, UTF-8 on Linux and Mac)
Use proper tools, such as Notepad++ or Sublime or Atom or or any other non-Microsoft text editor:
https://notepad-plus-plus.org/
:idea: Please read the FAQ and How to Request Help.
karanrajpal14
Posts: 23
Joined: 03 May 2015, 16:21

Re: Invalid Identifier issue

Post by karanrajpal14 »

Oh, that makes sense. I did skim through the notes but I didn't notice the text withing the parentheses. To be fair, the text is really small.
Anyway, your suggestion to use other text editors helped. I'm using sublime now and everything's fine. Thank you so very much!
Post Reply