Below is the some sample code with comments on how to convert to a Fixed Width format.
// sample Pipe Delimeted |12345|First|M|Last|stuff|otherstuff|etc|
//Create Message as Fixed Width
message = qie.createFixedWidthMessage(200);
//Retrieve Values from Original Message and write fixed width message
// Fields Begin Index Width Description
// 1 1 10 Not Used
// 2 11 20 ID
// 3 31 20 First Name
// 4 51 20 Middle Name
// 5 71 20 Last Name
// 6 91 20 Stuff
// 7 111 20 Other Stuff
// 8 131 20 etc
// setNode syntax for fixed width - Begin Index, Width [ Row Index ]
var count = source.getCount('*');
qie.debug('Row Count: ' + count);
// Loop through each row and create the fixed width
for (var j=0 ; j < count ; j++) {
var row = source.getNode('*[' + (j + 1) + ']');
qie.debug('Row: ' + row);
// verify the row has data
if (row.length() > 0) {
// Split the row to an Array
var rowArray = row.split('\\|');
qie.debug('Row Array Size: ' + rowArray.length);
// Loop through the Array of values and set the new message
var field = 0;
message.setNode('1,10[' + j + ']', rowArray[(field + 1)]);
message.setNode('11,20[' + j + ']', rowArray[(field + 2)]);
message.setNode('31,20[' + j + ']', rowArray[(field + 3)]);
message.setNode('51,20[' + j + ']', rowArray[(field + 4)]);
message.setNode('71,20[' + j + ']', rowArray[(field + 5)]);
message.setNode('91,20[' + j + ']', rowArray[(field + 6)]);
message.setNode('111,20[' + j + ']', rowArray[(field + 7)]);
}
}