Very often it happens that you have to create fixed-width text files. This activity can also be done through Data Management.
Fixed-width files are text files where each piece of information is not delimited by a separator but there is a convention which indicates, for example, that the first 5 characters are an identifier, the second 100 a description and so on.
To set data management to create this type of file, follow the following procedure:
- Go to the Data Management area and click on Configure Data Source to create a new type of export format.
- From the Source data formats form click on New and start creating the new format in this way:
- Enter the name and description of the format; set File Format = Fixed Width and put also Row Delimiter = {LF} (when entering {CR}{LF} I encountered problems creating the file – empty spaces were inserted at the beginning of the line).
- Create a new export project by selecting the entity to export and setting the Target Data Format with the one just created (in my case TestFixFormat)
- At this point there are two actions left to do. If it is necessary to export only a subset of fields, remove them from the mapping (click on View map and then Mapping details and delete unnecessary fields). Then click on Entity Attribute where you can determine the structure of the file to export.
- In the Entity Attribute form we have the possibility to see all the fields, remove them, change the order and modify their length.
- Now we can then launch the export