sync:definition
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sync:definition [2021/06/03 04:24] – [CSV Source File] Scott Cunliffe | sync:definition [2025/01/21 22:07] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| ==== CSV Source File ==== | ==== CSV Source File ==== | ||
| - | sample CSV file: CSV_source.csv | + | sample CSV file: '' |
| volume, | volume, | ||
| - | 000000L6, | + | 000000L6, |
| - | 000001L6, | + | 000001L6, |
| - | 000002L6, | + | 000002L6, |
| - | 000003L6, | + | 000003L6, |
| - | 000004L6, | + | 000004L6, |
| - | 000005L6, | + | 000005L6, |
| - | 000006L6, | + | 000006L6, |
| - | 000007L6, | + | 000007L6, |
| + | CLN00012, | ||
| | | ||
| === Add File Type Directives === | === Add File Type Directives === | ||
| Line 38: | Line 39: | ||
| setCSVDelimiter("," | setCSVDelimiter("," | ||
| + | | ||
| + | === Add Exclusion Directives === | ||
| + | |||
| + | Skip any line starting with volume, as it is a heading and not a Volume | ||
| + | Skip any Volume that starts with CLN. | ||
| + | |||
| + | AddString(EXCLUSION, | ||
| + | AddExclusionOnValue(VOLUME, | ||
| + | |||
| + | |||
| ==== Setting Literal Values ==== | ==== Setting Literal Values ==== | ||
| Sync constants, such as Customer-ID and Media-ID, can be set using literal values as these values do not change. | Sync constants, such as Customer-ID and Media-ID, can be set using literal values as these values do not change. | ||
| + | Set Scratch to true. | ||
| setLiteral(CUSTOMER, | setLiteral(CUSTOMER, | ||
| setLiteral(MEDIA, | setLiteral(MEDIA, | ||
| + | setLiteral(SCRATCH, | ||
| + | | ||
| + | ==== Define Fields ==== | ||
| + | |||
| + | Definition fields to pass date format to Sync engine, Y=YYYY (y-YY), m=mm, d=dd. | ||
| + | Permanent date value sets the specified date to Permanent or no next move date. | ||
| + | |||
| + | SetMoveDateFormat(" | ||
| + | SetPermanentDateValue(" | ||
| + | |||
| + | |||
| + | ==== Extract Data Fields ==== | ||
| + | |||
| + | Extract Volume-ID from column 1, length 10 | ||
| + | Remove spaces from Volume-ID in case it is less than 10 digits | ||
| + | |||
| + | Extract(VOLUME, | ||
| + | RemoveSpaces(VOLUME); | ||
| + | | ||
| + | |||
| + | Extract Location from column 4, length 20 | ||
| + | Remove spaces from location in case it is less than 20 digits | ||
| + | |||
| + | Extract(REPOSITORY, | ||
| + | RemoveSpaces(REPOSITORY); | ||
| + | | ||
| + | Extract Description from column 5, length 30 | ||
| + | Remove Spaces from Description in case it is less then 30 characters | ||
| + | |||
| + | Extract(DESCRIPTION, | ||
| + | RemoveSpaces(DESCRIPTION); | ||
| + | | ||
| + | Extract Movedate from column 5, length 11 | ||
| + | |||
| + | Extract(MOVEDATE, | ||
| + | ==== Translate Fields Directly ==== | ||
| + | |||
| + | Translate Repository data to TapeTrack Repository-ID' | ||
| + | Offsite = OFFS | ||
| + | Library = LIBR | ||
| + | Racking = RACK | ||
| + | |||
| + | AddTranslation(REPOSITORY, | ||
| + | AddTranslation(REPOSITORY, | ||
| + | AddTranslation(REPOSITORY, | ||
| + | |||
| + | |||
| + | ==== Translate Fields Indirectly ==== | ||
| + | |||
| + | Translate Scratch value, set to False if Volume location is Offsite | ||
| + | |||
| + | AddTranslation2(SCRATCH, | ||
| + | | ||
| + | |||
| + | ==== Complete Definition File ==== | ||
| + | |||
| + | setCSVDelimiter("," | ||
| + | | ||
| + | setLiteral(CUSTOMER, | ||
| + | setLiteral(MEDIA, | ||
| + | setLiteral(SCRATCH, | ||
| + | | ||
| + | Extract(VOLUME, | ||
| + | RemoveSpaces(VOLUME); | ||
| + | | ||
| + | Extract(REPOSITORY, | ||
| + | RemoveSpaces(REPOSITORY); | ||
| + | | ||
| + | Extract(DESCRIPTION, | ||
| + | RemoveSpaces(DESCRIPTION); | ||
| + | | ||
| + | SetMoveDateFormat(" | ||
| + | Extract(MOVEDATE, | ||
| + | | ||
| + | AddString(EXCLUSION, | ||
| + | AddExclusionOnValue(VOLUME, | ||
| + | | ||
| + | AddTranslation(REPOSITORY, | ||
| + | AddTranslation(REPOSITORY, | ||
| + | AddTranslation(REPOSITORY, | ||
| + | | ||
| + | AddTranslation2(SCRATCH, | ||
| + | | ||
| + | <- sync: | ||
sync/definition.1622694275.txt.gz · Last modified: 2025/01/21 22:07 (external edit)
