CREATING EDITABLE DOCUMENTS FOR AN OFFICE
Problem: The office produces some huge reports using LibreOffice. To much text to type!
Solution: These reports are water sample analysis.
1) The lab feeds the results into a postgresql database.
2) When finished the work on the water sample by the lab, an office software alerts its user.
3) This software has a odt report template, which is copied to another directory for edition and uncompressed there.
4) All the data is in the content.xml file. So, we could use a script to edit some placeholders we have in our template. Here is an example:
Code: Select all
#!/bin/bash
cd "$1"
sed -i "s~$2~$3~" content.xml
Code: Select all
#!/bin/bash
ftp -n <<EOF
open ftp://IP
user name password
put $1
EOF