# Usage: npx ezs -e enrich-etab.ini
# To see the enriched notices:
# $ fx < data/corpus-simple-etab.json '.filter(o => o.ws.rnsr[0]?.length)'
[use]
# JSONParse FILELoad FILESave
plugin = basics
# read data
[exchange]
value = [ "corpus-simple-rnsr.json" ]
[JSONParse]
[FILELoad]
location = data
[JSONParse]
# Concaténation des sigles et libellés des établissements associés
[assign]
path = ws.etab
value = get('ws.rnsr', []).map(structs => structs.map(struct => `${struct.sigle}: ${struct.intitule}`)).flatten()
# Save data
[dump]
indent = true
[FILESave]
location = data
identifier = corpus-simple-etab.json
[dump]
indent = true