The FileReconstructor Add-In reads an existing file, reforms the content line by line based on configured rules and writes the reconstructed lines to a new file.

features                                                                                                                                                      
Add-in type Logic
Interfaces In/Out: file directory
Transactions 1 per file created
Events Per created file: <instance>.Output (parameter = file)
<instance>.Done
   
parameter  
inputFile Source file including directory. Multiple files possible (optional).
reconfiguration Conversion rules applied line by line.
1. Reference to the original line: curly brackets in the format {index start character, index end character, [text length], [padding character], [horizontal alignment]}
  a. If the text length is not specified, it is calculated on the end and start index.
  b. If no end index is specified, this is calculated on the basis of the start index and the text length.
  c. If the end index is outside the actual line length, the index of the last character in the line is used.
  d. If the text length is greater than the difference between the end and start index, the padding character is used (default = space).
  e. The padding character is inserted on the right or left depending on the alignment (‘left’ / ‘l’ (standard) or ‘right’ / ‘r’).
2. Fix Text: Enter in single quotation marks (‘) or quotation marks (“)
outputFile Target file. Placeholder:
{now}: Current date
{file}: Filename of the input file
outputPath Target directory (optional, default = “”)
deleteInputFile true = source file will be deleted (optional, default = false)
userName Users with the necessary permissions for the target file (Optional)
password Associated password (optional)
endpoint Name of the endpoint that is used in the transaction (optional, default = “”)

Application examples

Source file with fixed column width -> target file CSV:

The input file contains columns with a fixed width, the content is as follows:
EUR1000     CHF1072
EUR400      USD430

The output file should consist of 6 columns separated by semicolons; Fill spaces for EUR with ∗:
TO;CHF;∗∗1072;FROM;EUR;1000
TO;USD;∗∗∗430;FROM;EUR;400

A possible configuration looks like this: ‘TO;’{12,,3}’;’{15,21,,∗,r}’;FROM;’{0,3}’;’{3,9}
- ‘TO;’ = fixer Text
- {12,,3} = 3 characters are copied from position 12 (e.g. CHF)
- ‘;’ = fixed text (semicolon)
- {15,21,,*,r} = copy position 15 to 21 and fill it with ∗ on the left side (because alignment = right) (e.g. ∗∗ 1072)
- ‘;FROM;’ = fixed text
- {0,3} = 3 characters are copied from position 0 (e.g. EUR)
- ‘;’ = fixed text (Semicolon)
- {3,9} = copy positions 3 to 9