|
Changing a CSV field |
Pipelines v1.6 |
.* Example by TenFiftyTwo(c). |
.* The following pipeline reads the input file: input.csv and feeds the records to the.* called pipeline: ParseCSV.ppl, which replaces the CSV field delimiter: ',' (comma) with a.* new delimiting character: x'ff'. .* The pipeline is then able to use this new field delimiter in the XLATE stage to isolate field.* number two in order to convert the contents to uppercase. After the translation, the original.* delimiter is restored and the records are displayed on the console. pipe < &installdrive:\&installpath\Examples\Input\input.csv .* Read input file.
| call "&installdrive:\&installpath\Examples\Handle arguments\ParseCSV.ppl" "," .* Current CSV demimiter. xff .* New CSV delimiter. | xlate fs xff f2 .* Translate field #2 to uppercase. | change xff /,/ .* Restore the original field delimiter. | cons .* Display on the console.