CIB merge technical documentation (EN)
6. Call parameters in detail
6.25. Parameter --directory-write
The command --directory-write=<virtual filename>=<filename> writes the contents of <virtual filename> from the virtual directory to the file <filename>. Any switches +/-/! etc. are not included in the name.
Syntax
--directory-write=<virtueller Dateiname>=<Dateiname>
Example
--directory-set=out=out.log --directory-write=out.log=!out.log
The virtual file named out.log is taken and the content written to out.log.
- Comparison: file-based and file-less data entry
Starting from a classic file-based example, alternatives are presented using the means just mentioned.
The output of the RTF can be done file-less with means described in other documents and is not mentioned here!
- Java merge job and retrieval of error text and number
Data input by file:
The data.csv should be merged into the input.rtf. The output is called output.rtf. Errors are written to merge.log. All files are located in the file system under directory test.
JCibMergeJob t_Job = new JCibMergeJob(); t_Job.initialize(); t_Job.setProperty(ICibMergeJob.PROPERTY_WORKSPACE, "test\\"); t_Job.setProperty(ICibMergeJob.PROPERTY_ERRORFILE, "merge.log"); t_Job.setProperty(ICibMergeJob.PROPERTY_DATAFILE, "daten.csv"); t_Job.setProperty(ICibMergeJob.PROPERTY_INPUTFILE, "input.rtf"); t_Job.setProperty(ICibMergeJob.PROPERTY_OUTPUTFILE, "output.rtf"); t_Job.execute(); int error = ((Integer)t_Job.getProperty(ICibMergeJob.PROPERTY_ERROR)).intValue(); if(error > 0) { String errortext = (String)t_Job.getProperty(ICibMergeJob.PROPERTY_ERRORTEXT); }
Data input without file:
Only data.csv should be transferred in the first step file-less. The content is in the string variable csv_data. The following additional property is set for this. (The rest remains unchanged)
t_Job.setProperty(ICibMergeJob.PROPERTY_DICTIONARY_SET, "daten.csv=" + csv_data);
- Merge job via parameter file (Java, C++ or COModSuite)
Data input by file:
Content of the merge.par file:
-L!merge.log -V -Ddaten.csv -Iinput.rtf -O!output.rtf -M@ -@1 -MEnde
Specify log file
Report version
Specify data, input and output files
Report file names
Merge single document
Call "cibmrg32.exe -@merge.par" to start the job.
Data input without file:
Similar to the case in Java, this is also possible in the parameter file:
The parameter file merge.par must be supplemented by the following specification (rest remains unchanged)
--dictionary-set-inline=daten.csv Var1;Var2;Var3…
Wert1.1;Wert1.2;Wert1.3… Wert2.1;Wert2.2;Wert2.3… … end-of-file
- Job from C++
Data input by file:
const char *const arguments[]= { „cibmerge“, „-L!merge.log“, „-Ddaten.csv“, „-Iinput.rtf“, „-O!output.rtf“, 0 }; cibmerge(sizeof(arguments)/sizeof(*arguments) – 1, arguments);
Data input without file:
Here the data is transferred in string constants. A better option would be to assemble them dynamically via stringstreams of the STL:
The arguments must be extended by the following specification (rest remains unchanged):
„--dictionary-set=daten.csv\n“ „Var1;Var2;Var3…\n“ „Wert1.1;Wert1.2;Wert1.3…\n“ „Wert2.1;Wert2.2;Wert2.3…\n“ „…\n“