on 04-17-2012 6:55 AM
Hi PI mates,
I have a problme of reading a file where last line it is coming like a special character "#" so i want to ignore the last line so that i can read other lines with field fixed lengths. i am getting only one character at the last line. i am using FTP & graphical mapping.
please provide your inputs on this.
Thank you,
Loordh.
Hi All,
Can you please help us is their any direct parameter is available to remove last line from the output file using SFTP.....PI....SFTP in FCC.
Thanks in advance!
Regards,
Sathya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Allamudi,
The Grzegorz solution seems the best. I was wondering that you could use a batch program and use it from the sender filer adapter (Operating System Command Before/After File Processing). It isn't to difficult to delete the last line:
sed -n "$!p" file
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Allamudi,
You could use a java mapping before the graphical mapping and ignore the last line. The code will be simple because you put in the ouputstream the inputstream, reading char to char and when the char is equal to # you finish the mapping.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can add the following parameters to the FCC configuration, this should solve your problem:
Structure.keepIncompleteFields = YES
Structure.missingLastfields = ignore
Then you just have to ignore this source structure item (where first field is equal to #) during message mapping. I believe this is the simplest way, without involving additional mapping. You could also define a separate Recordset Structure for this last file line, assuming that you have some key field that will help you distinguish between "normal" line and this one last line. But I think the first solution I described requires less changes to your scenario.
Hope this helps,
Greg
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.