Convertir les dates saisies au format texte en format date (à appliquer sur le `content.xml` dans le fichier ODF) : {{{#!python #!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re PAT1 = r'[^>]*)office:value-type="string">(?P\s*)(?P[0-9][0-9])/(?P[0-9][0-9])/(?P[0-9][0-9])(?P\s*)' PAT2 = r'office:value-type="date" office:date-value="%(year)s-\g-\g">\g\g/\g/\g\g' def text2date(matchobj): year = int(matchobj.group('year')) if year < 100: year += 1900 if year < 1930: year += 100 return matchobj.expand(PAT2) % {'year': year} pattern = re.compile(PAT1, re.MULTILINE) sys.stdout.write(re.sub(pattern, text2date, sys.stdin.read())) }}}