cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP Sender - Processing & Archiving file without any extension

ramiz_sipai
Explorer
0 Kudos

Hi All,

We are using SFTP sender channel to process the file.

The challenge is - We are not able to process & Archive the file if the file does not have any extension. (ie : .txt)

We used different wildcard characters also but no luck.

Few more information :

File name in sftp server to process is                : I061_141020_123411

Directory configured in SFTP sender channel   : /IN

File name configured in SFTP sender channel : I061*.*

Archive file on SFTP server                               : /Archive

We  are getting mainly two errors/longs in the channel. : 

     - No new file.. or...

     -  Exception received: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Thank you.

Ramiz.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

If you have filename define issue in sender SFTP adapter. Please check below.

E.G my file name is ABC_<timestamp>.txt or ABC_<timestamp>.TXT

Then I need to define ^ABC_[\s\S]*\.[tT][xX][tT]$

^ABC_: start with ABC_

[\s\S]*: any string value between the prefix and extention.

\.: the dot

[tT][xX][tT]$: end with "txt" case-insensitive

engswee
Active Contributor
0 Kudos

Hi Ramiz

The filename field in the SFTP sender adapter requires a regular expression. The behavior is different from the normal File/FTP adapter.

To use the character * in regular expressions, it needs a preceding element.

Try using the following to see if it works:-

I061.*

The above regular expression will search for any names that starts with I061 followed by any single character (.) that occurs zero or more times (*)

Rgds

Eng Swee

ramiz_sipai
Explorer
0 Kudos

Hi Eng Swee,

Yes. I tried that too... But it gave me error while Archiving : "String index out of range: -1"

It looks like the archiving module is always looking for some extension.

Exception received: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Transfer finished, average speed was 262.8 KiB/s

Initializing transfer operation GET with source /SAPPI/SAPINB/I061/I061_141020_151515 and size 126.7 KiB

Processing file I061_141020_151515

Found 1 file

Directory under file Path 5 returned {1}. These include directories and links.

Listing /SAPPI/SAPINB/I061/

I have open sap message for this. Lets see what solutions they are providing.

Thank you for the reply.

Regards,

Ramiz.

Former Member
0 Kudos

Hi Ramiz,

Do you get a solution for this issue?

Could you share with us?

I've the same issue when trie to arquive the file.

Regards.

Halsen

naveen_chichili
Active Contributor
0 Kudos

Hi Ramiz,

It should work with I061*

Regards,

Naveen

ramiz_sipai
Explorer
0 Kudos

No Naveen, it is not working.

The interesting thing is :

File w/o extension is getting processed & archived on File system (NFS mount) but not on SFTP server.

But my requirement is to archive in SFTP server only from where I am processing the file.

Former Member
0 Kudos

Try .*1061.*

Thanks.

Harish
Active Contributor
0 Kudos

Hi Ramiz,

AFAIK - you can not use the *.* is the channel. Please refer the below discussion

the file name in channel can be configure as

I061*


regards,

Harish

ramiz_sipai
Explorer
0 Kudos

Thank you Harish for reply...

But I have already used below file names in PI.

But no luck. File is not getting processed.

I061*

I061_YYMMDD-hhmmss

I061*.*

I061_*

I061_%

I061_######-######-###

I061_*######*######*###

I061_[0-9]{6}_[0-9]{6}

I061_*

I061_[0-9]12

Thank you.

Ramiz.

Former Member
0 Kudos

Is this file name working when u have a extension in the file

I061*

Regards

Osman

ramiz_sipai
Explorer
0 Kudos

Yes Osman, File is getting processed and archived when file has any extension.

The interesting thing is :

File w/o extension is getting processed & archived on File system (NFS mount) but not on SFTP server.

But my requirement is to archive in SFTP server only from where I am processing the file.