Focal Point
File object side effects (iWay 5.5)

This topic can be found at:

August 06, 2008, 03:50 AM
File object side effects (iWay 5.5)
Hi everybody

I have a little problem with the file object. I'm developing a process that read information from a file and makes queries to a database. It is a plain text file in which each record has a fixed width of characters. After reading the file, i transform it to xml.

I've chosen the CDF format in the iWay transformer. I've made many tests and it works well (in the iWay transformer application)

But i've problems when i publish it to the server. The file object, in read-mode, eats blanks. So, the file registers are no longer fixed width. For example (underscores are blank spaces)


turns into


I would like to know if this problem is a bad parameterization of the file object or i have to do a exorcism to the server.


PD: Sorry, my english is horrible

iWay 5,5,13562,0
August 19, 2008, 02:20 PM
There is another way to do this and it is to use the file listener on a channel which would pass it into the system. You can pass the file in as flat and then pick it up with the transform object. I am not sure what is happening with the file object and why it is eating the spaces. If you send me the file, I can try it on my side and see if it happens here too.
August 20, 2008, 05:51 AM
ok thanx, i'll try to do it with the file listener

iWay 5,5,13562,0
August 20, 2008, 10:09 AM
Are you sure it is the file read that is changing the data? (Either this object or the file listener should pick it up without modifying it, and this has been well tested; and it seems odd that it would leave one blank). At what point are you looking at the data? if you put a file write immediately after the read, what does that give? What is the transformer doing CDF to XML? there are TRIM functions in there that may be On ...

August 21, 2008, 12:01 PM
One thing you need to remember if you are using the file listener and then transforming from CDF to XML is to set the "Accepts non-XML (flat) only" to be true. The allows the CDF to get into the route correctly. One side effect is you will not be able to run any sort of pre-parser on the file if you needed to. That may or may not be an issue depending on the application.
August 22, 2008, 08:47 AM
CSV transforms can be called using the XMLGpreParser if desired. Once the data has been converted it can be routed to the appropriate route.

August 26, 2008, 01:06 PM
There are two seperate options on how to handle the file coming in. Naomi is correct in that it can be parsed with the XMLGpreParser. Then the transform would need to be an XML to XML transform instead of CDF to XML. This is the best way to go in case you ever needed more preparsers within the channel. The second option is what I explained before where you can pull it in flat and then perform a CDF to XML transform. Two different options which can accomplish the same task.