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)
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
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. email@example.com
ok thanx, i'll try to do it with the file listener
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 ...
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.
CSV transforms can be called using the XMLGpreParser if desired. Once the data has been converted it can be routed to the appropriate route.
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.
|Powered by Social Strata|