TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


engine:import:addtranslation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
engine:import:addtranslation [2020/02/24 00:59] Scott Cunliffeengine:import:addtranslation [2025/01/21 22:07] (current) – external edit 127.0.0.1
Line 8: Line 8:
  
 ''AddTranslation(field, filter, translation);'' ''AddTranslation(field, filter, translation);''
-//string field;// + 
-//string filter;// +^ Variable ^ Type ^ Description ^ Min Length ^ Max Length ^ 
-//string translation;//+|field| String | The field to be translated.| 1|128| 
 +|filter| String | A filter to compare against the current field value.|1|256| 
 +|translation| String | The new value of the field. This can either be a new literal value, or the original value with a prefix or suffix.|1|256|
  
 <notetip> <notetip>
Line 18: Line 20:
 record.</note> record.</note>
 <notetip> <notetip>
-Although an AddTranslation2 is functionally equivalent to a AddTranslation with the same +Although an [[engine:import:addtranslation2|AddTranslation2]] is functionally equivalent to a AddTranslation with the same 
-field and field2 values, AddTranslation entries are processed first, and then AddTranslation2+field and field2 values, AddTranslation entries are processed first, and then [[engine:import:addtranslation2|AddTranslation2]]
 entries are processed a 2nd time. This allows you to translate the value of the field2 entries are processed a 2nd time. This allows you to translate the value of the field2
 comparison field first, and then translate the value of the field based upon the translated value comparison field first, and then translate the value of the field based upon the translated value
Line 29: Line 31:
 to drop.</note> to drop.</note>
  
-|field| The field to be translated.| 
-|filter| A filter to compare against the current field value.| 
-|translation| The new value of the field. This can either be a new literal value, or the original value with a prefix or suffix.| 
  
-==== Example ==== 
-**AddTranslation: Append L3 to each VOLUME field if the value 
-starts with a zero.** 
-<sxh>AddTranslation(VOLUME, "0*", "*L3");</sxh> 
  
-==== Example ==== +===== Example ===== 
-**AddTranslation: Truncate a VOLUME field to 6 characters when the Volume-ID starts with an A.** +Append L3 to each VOLUME field if the value starts with a zero. 
-<sxh>AddTranslation(VOLUME, "A*", "~~~~~~");</sxh>+<code>AddTranslation(VOLUME, "0*", "*L3");</code> 
 + 
 +Truncate a VOLUME field to 6 characters when the Volume-ID starts with an A. 
 + 
 +<code> 
 +AddTranslation(VOLUME, "A*", "~~~~~~"); 
 +</code> 
 + 
 + 
 +Remove the first 3 characters from a [[object:volume|Volume-ID]] A12345678 and add suffix L4 
 + 
 +<code> 
 +AddTranslation(VOLUME, "A*", "^^^~~~~~~L4"); 
 +</code> 
 + 
 +===== See Also =====
  
-==== Example ==== +[[engine:import|Import Engine Functions]] \\ 
-**AddTranslationRemove the first 3 characters from a Volume-ID A12345678 and add suffix L4 +[[cli:sync_fields|Sync Engine Fields]] \\ 
-<sxh>AddTranslation(VOLUME, "A*", "^^^~~~~~~L4");</sxh>+[[cli:tmss10sync|TMSS10Sync]]
  
 {{tag> import_engine sync_engine}} {{tag> import_engine sync_engine}}
engine/import/addtranslation.1582505947.txt.gz · Last modified: 2025/01/21 22:07 (external edit)