cancel
Showing results for 
Search instead for 
Did you mean: 

Question for File output

Former Member
0 Kudos

Hi experts,

is it possible for XI when it scans a folder from FTP to only pick 1 file every time it scans ?

For example, i have 5 file on my folder, but i want my files to be processed every 30 minutes each by XI

Kind regards,

Jamal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

1) you can poll the files with a specific file name

2) write a script file which does the renaming of the file (and called by the OS command in the adapter), ofcourse you should rename the right file among the 5, based on ur logic

3) and run the OS command before the message processing & call the script to rename the file that would be picked up by the adapter.

there are lots of ways you can try this, but it is one of such ways

Regards

Vishnu

Answers (7)

Answers (7)

Former Member
0 Kudos

This might help you...

/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi

Former Member
0 Kudos

Hi,

do you know anyother way for XI to pick only one file everytime it scans a folder ?

I can not manage to execute my command in the OS command before message processing...

Kind regards,

Jamal

Former Member
0 Kudos

Could not manage to do so

Former Member
0 Kudos

Thanks a million!!!

should i put that in a .bat file ?

Regards,

Jamal

Former Member
0 Kudos

Hi

it depends on ur environment...

example:

windows.. (.bat)

unix : .sh etc..

the logic & coding may also differ... so check the tutorials in the net and develop the one which is useful for your env.

the above is just an example .. the same may not work fine for ur situation

Regards

Vishnu

Former Member
0 Kudos

Thanks!

any chance you help me with the script ?

i dont even know where to start...

Kind regards,

Jamal

Former Member
0 Kudos

hi

u have to look in net..

this is a simple script which increments filename, when it is number

#!/bin/bash

for i in $(ls *.gif| sort -nr)

do

x=$((${i%.gif} + 1))

echo mv $i $x.gif

done

but.. u need to work it yourself, based on ur environment , logic etc... & keep testing

Regards

Vishnu

Former Member
0 Kudos

Thanks a lot for your answers.

I did not really get your point 2)

how do I write a script file ? Im not really good at this

Kind regards,

Jamal

Former Member
0 Kudos

the file will be picked based on file name..to avoid the adapter picking all of them, you have to give a specific file name & not like "abc*"

so if all the files are in the same directory, the adapter may pick all of them..irrespective of poll interval

so to distinguish it, u need to change the filename which will be picked by adapter.. and this will be done by the script...

this way even if 5 files are there.. ur script will indirectly feed ur adapter with the right file (by changing the filename)

you can look for simple script files in the net & develop your logic.

hope it is clear..

Regards

Vishnu

prateek
Active Contributor
0 Kudos

Then simply put poll interval as 30*60 seconds.

Regards,

Prateek