Rename PAC files and correct Story/Lang

Process ID: FB-SUB-RENAME


Rename PAC files and correct Story and Lang in Subtitle Zero based on a CSV file



Input File types: PAC

Output File type: PAC


Pricing:

Pay Per Item Price:

A charge of €0.20 is made for each successful renamed and re-Storied file.
If enable the removal of a 2nd subtitle zero’ or ‘enable the creation of subtitle zero where it does not exist’ is set, and this is required, an extra charge of €0.50 is made


How to run Rename PAC

The process is designed to:

  • Read a CSV file containing old and new material IDs.
  • Watch a folder for input .PAC files.
  • Process .PAC files to rename them and change Story: and Lang: in subtitle zero.
  • Requirements:
  • The CSV file should have a header line, and can have multiple columns.
  • It should have one column containing the new material ID, and can have multiple columns containing the existing material ID.
  • If there is a column named ‘type’ and the entry in the column is not ‘subtitle’, that line will be ignored.
  • If you wish to process files which have ALREADY been renamed, just add the new material ID column name to the list of existing material ID columns.

Example simple CSV:

newid,orgid
M1234567,X34567
M34567,X333333

Example more complex CSV:

type,newid,orgid,orgid2,comment,title,episode
subtitle,M1234567,X34567,y667554,,My Title,My Episode
audio,"0034567",0333333,a44444,will be ignored

Note about numeric IDs:

For the new ID, if you want to retain leading zeros, the id MUST be quoted in the CSV, otherwise leading zeros will be removed.

For the original id, if unquoted and pure numeric, the input filename will also be compared with leading zeros removed.

The CSV columns used are configured in the process configuration.

column name for new ID – this should be the column name (header entry) for the column containing the new material id.

comma separated list of original id columns – this should be a list of column headers which represent old material ids.

Language identifiers can be modified during the process – this is configured int he process configuration:

comma separated list of language substitutions, e.g DNK=DAN,ARB=ARA

For example, entering DNK=DAN,ARB=ARA will convert both LANG: and tail of new file name from DNK to DAN if found.

Input PAC file names.

The process recognises the following file naming conventions:

STORY-LNG.PAC
STORY_LNG.PAC
SLNG.PAC - e.g. GBHIST000896GBHIS002XSHRV.PAC

in the case of UPN20, the CSV should contain the UPN20, not including the version or ‘S’.

Output PAC file names:

The process will write files as

STORYLNG.PAC

The separator is configurable – e.g. you can choose ‘-‘ or ‘_’ according to your convention.

The process can be configured to write files into a folder per new material ID if desired (set ‘Create a separate folder per id’ to true).

Process:

The input filename is split into it’s material id and LNG.  The material ID is matched against an ID from the ‘original id’ columns, and the resulting ‘new ID’ used as the new material ID.

The LNG is modified if in the language substitutions, else used as-is.

Story: and Lang: are replaced in subtitle zero with:

STORY: NEWMATID
LANG: NEWLNG

Note that the replacement is done in place (i.e. they will be in the same positions that they were).  The process does check that Story: and Lang: are at the start of line, and if not may reject the file indicating manual intervention is required.

Additional modifications can be enabled:

‘enable delete of trailing subs which have no lines’ will remove empty subtitles from the end of the file.

‘enable the removal of a 2nd subtitle zero; note additional cost’ will enable the removal of a second duplicate subtitle zero where it exists, at an extra cost of 50c, only where required.

‘enable the creation of subtitle zero where it does not exist; note additional cost’ will enable the creation of a subtitle zero from the CSV ID and LNG, plus up to 4 additional ‘tag’ fields as specified in the configuration.  An extra 50c is charged each time a subtitle zero is created.

The process will process up to ‘Maximum files to process in a batch’ files each time it scans the folder, then wait for the configured scan interval before starting another scan.

A log file is generated, named as per the configuration, with date appended; e.g. ‘modpac_2019-11-21.txt’