Use the Add Fields tool to insert and/or append fields to lines of a text file. Unlike the Organise Fields tool which restricts the number of fields per line to a maximum of 25 and requires each input line to contain the same number of fields, the Add Fields tool can accommodate an unlimited number of fields per line, and there is no requirement for each line to contain the same number of fields, although by selecting the Enforce Strict Field Count box this latter requirement can be activated. Procedure
![]() By default, the Add Fields tool prepends fields when it encounters empty Insert Fields After boxes that are numbered less than a box with a user-supplied non-zero position. For empty boxes numbered higher than the highest non-zero user-supplied position box, fields are appended. If all boxes are empty, all fields are appended. For example, in the screen display shown above, five of the Insert Fields After boxes are empty (boxes 1, 2, 3, 5 and 7). The first three empty boxes are treated as if the user had entered a number 0 in each of the boxes, and three fields are therefore inserted after field 0 - i.e. they are prepended. Since Insert Fields After box number 6 contains the user-supplied value of 0, a fourth field is also prepended. Insert Fields After box number 4 contains the user-supplied value 2 and a field is therefore inserted after field 2 of each line of the input file. The other two empty boxes (boxes 5 and 7) are numbered higher than the highest non-zero user-supplied position box (box 4) and two fields are therefore appended. |
Limitations
|
CautionThe output file generated by the Add Fields tool will always, obviously, be larger in size than the input file, but the difference in size can be significant when the Align Fields control is selected. |