cancel
Showing results for 
Search instead for 
Did you mean: 

Special characters in the file

former_member234749
Participant
0 Kudos

Hi All,

There is a order file for every 30 mins in the server and PI needs to pickup the file by using SFTP channel. The file is always contains three special characters() at starting of the payload as below.

if there are no orders in the time frame, they are placing the blank file in the server and it has the three special characters as below.

If the file contains the payload, there is no issues in PI mapping and will be processed to ECC through proxy. but when PI picks the above empty file it is throwing error as it contains the three special characters. I tried with the option skip empty files, but didn't work as it has special characters.

Can anybody give suggestions on how can we handle this without mapping error in PI moni. I just want skip this type of files.

Thanks,

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi,

The easiest is as Hareesh suggested to talk with the sender partner to avoid create the files with that three characters. Another way is to execute a OS command to delete that three characters. Check this link unix - delete the first 5 chars on any line of a textfile in Linux with sed - Stack Overflow and later you can use the option Processing parameters->Process Empty File->Skip Empty File.

I think, i'm not sure, the command is executed in the PI OS and not in the SFTP server. This could be problematic, however you can try it.

Regards.

former_member184720
Active Contributor
0 Kudos

>>>I think, i'm not sure, the command is executed in the PI OS and not in the SFTP server.

It's on PI OS.

former_member184720
Active Contributor
0 Kudos

Either ask the sending system to create the blank files without BOM or stop creating empty file.

Another option is to make use of context object "SourceFileSize" in receiver determination condition.

"SourceFileSize" != //filesize with just BOM indicator. I believe you can find this filesize in audit log.