cancel
Showing results for 
Search instead for 
Did you mean: 

Brain teaser with file adapter

Former Member
0 Kudos

Hi, all.

Here is the requirement:

1) PI will browse in a fixed directory: /interfaces/in and look for all files with a specific pattern as file name. They are all text files.

2) Once it sees the file, it will look for a specific pattern NNN inside that file. The file will only have one line with pattern NNN.

3) If the file doesn't have that pattern, PI will ignore the file and no processing is happening

4) In the next loop, if it finds a file with pattern NNN, remove the line with pattern NNN from the file but remember the content of that line. Ftp the new file into a FTP directory with file name of that line.

Is it achievable by standard file adapter? Even with shell script with the command line, I still cannot quite get the result I want. Your input would be greatly appreciated.

Thanks,

Jonathan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, all

The interface is done. However, I have to make assumption that if the input file doesn't change in 2 minutes, PI is assuming that the sender system has finished its data transmission and the file will be picked up by the interface. So if there is no pattern NNN in the file, the message will fail via the mapping.

I guess the biggest challenge for me is how to tell PI not to process a message based on a condition. I haven't found a solution yet. Since there is no input on this thread, I will close it. However, I would still appreciate if you can comment on it.

Thanks

Jonathan.

0 Kudos

Hi Jonathan,

This can be achievable by using below approach but it's bit lengthy and may expect some performance due to extended receiver determination.

1. In Sender File adapter,  Select delete check and have file content conversion.

2. Use extended receiver determination - to check whether the message is relevant to pattern NNN .  If it is not , please use ignore button. else please process the file and create a  target file with only NNN.

Hope this meets your requirements.

Regards,

Umamahesh.

Former Member
0 Kudos

Thanks, that works and we are not expecting to receive a large volume of files. The performance impact should not be a big deal in my case as the file adapter is only looping every 15 minutes. I haven't thought about using the receiver condition. I guess it's too late to make the change, but I really appreciate your input and I have learned something today.

Regards

Jonathan.


Answers (0)