Browse Source
Adds the ability to customize CSV exports through the use of a YAML file.
The following customizations are available :
- Preprocessing
- Postprocessing
- Field-by-field processing
The YAML field should be stored in the tools/csv-profiles/ directory and
named after the id of the CSV profile you want to customize.
An example file is provided in that directory.
(cherry picked from commit 76655b5b94
)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
3.2.x
6 changed files with 155 additions and 61 deletions
@ -0,0 +1,15 @@ |
|||
# CSV Export custom processing example |
|||
# (should be name according to the csv export id : 1.yaml for example) |
|||
--- | |
|||
# preprocessing |
|||
# Deactivate quoting |
|||
$csv->quote_char(''); |
|||
--- | |
|||
# postprocessing |
|||
# Adding a trailer at the end of the CSV file |
|||
$output .= "This is a trailer"; |
|||
--- | |
|||
# field processing |
|||
# Adding "Word " before each 001 |
|||
if ($marcfield eq '001') { $value = 'Word ' . $value; } |
|||
--- |
Loading…
Reference in new issue