Why not create a template using Excel? Use placeholders (for example, $ {name.of.field}) for the values ββyou want to replace, but otherwise put everything as needed. Use another placeholder to mark the end of the template (this will allow you to write comments or other data outside this space to document your template).
Then, either through JExcelApi or Apache POI,
- open the template file and find the end marker of the template.
- open target file
- for each record, copy the fields from the template by substituting the $ {xyz} values ββfor their actual contents and stop when you reach the end marker of the template.
- close target and pattern
Changing the template will be extremely simple. The only problem is synchronizing the field names.
source share