cancel
Showing results for 
Search instead for 
Did you mean: 

Reading file in XI

Former Member
0 Kudos

Hello,

I have a scenario where I need to query the database and get the list of files to be read from local path. Then these files are to be uploaded to FTP server.

How can I read these files from local path where the filename of the file to be read is in message payload.

Please help.

Thanks in advance,

Beena.

Accepted Solutions (1)

Accepted Solutions (1)

VijayKonam
Active Contributor
0 Kudos

I dont think using XI would be right for this kind of requirements...!! It would be costly to us XI for such requirements.

VJ

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey

do u really want to do this scenario via XI:)

anyways,see you need to split your scenario into two parts,the first scenario would be sender system->XI->JDBC synchronous.

get the names of all the files and store them in a flat file.

now write a Perl or Unix script to read the first file name,open a I/O stream and then write the file to FTP server,similarly read the subsequent file names,open I/O stream and deliver them.you need to schedule this script using windows scheduler or some other tool available.

Thanx

Aamir

Former Member
0 Kudos

Thanks for reply.

Can I write adapter module for file receiver(ftp) , read the file name from payload and read the file from local path and upload to ftp?

It is actually part of scenario where I have types of files and no of days.

I need to get list of all files for given type for each day, get the data from database , append the file name and read the files and then upload it to ftp.

And then update another file for all the files which are processed.

This scenario is scheduled for everyday.

Thanks,

Beena.

Former Member
0 Kudos

Hey

what is the sender system in your case?

adapter module can be an option but i have never tried it though,i had a similar kind of requirement and i used scripts.

see if u want to avoid scripts them chances are you need to use BPM or modules(if the sender does not supports sync scenarios),BPM leads to performance issues.

let us know ur sender system so that we can help you better

Thanx

Aamir

Former Member
0 Kudos

Thanks for Reply.

Actually I need to schedule this in xi itself.

Everyday I need to get the list of files and upload them.

I also need to read one file which contains all files that are processed (Ids).

I have to upload the files from the list only if it does not exist in Id file.

I have to update the Id file once file is uploaded.

I was planning to use file sender channel to read Id file everyday.

Then I will use value mapping table to read types of files and no of days.

I will read the database for list of files.

I think I can not avoid BPM here as I need to update the Id file once all files are uploaded to ftp.

So I need to retain the Id file status.

However whether I use BPM or not, I dont find way to read the files from local file with dynamic file names in request/reply mode as XI is demanding data here and file adapter is asynchronous.

Let me know if I can avoid BPM here or if there is other way to do this to avoid scripts. I want to upload the files using ftp channel only, but I think I will have to use script or module to read files from local path.

Thanks,

Beena.

Former Member
0 Kudos

so basically your scenario would be File to JDBC sync.

if u want to avoid BPM you can use modules on sender File adapter to make it sync.there is a thread on SDN(not blog) by Bhavesh where he has given the name of modules u can use to make File adapter sync,but that works only after SP19.

now lets assume that your sender file adapter has been made sync(via modules)so now u can send the request to JDBC and get the names of files in payload.

and write this on the file system,so now u have a file on the File system containing the names of all the files to be picked up.

here u will run a script after message processing,this script will read the list of files and upload them to FTP.

you can avoid BPM provided ur on SP 19 else u have to use BPM to get response to file

Thanx

Aamir

Former Member
0 Kudos

Aamir,

Thanks for reply.

I think I dont need script if I am writing names of files in a file.

I can poll on this file and use variable substitution in file receiver(ftp) to get names of files from payload and upload it to ftp.

Thanks,

Beena.

Former Member
0 Kudos

Sorry.I missed it. This will not help. I need a script to read files.

Thanks,

Beena.

Former Member
0 Kudos

u got me confused now:)

>>I think I dont need script if I am writing names of files in a file.

ofcourse u don't need scripts for this,i was talking about another thing

see the file which will be delivered to you from JDBC will have a list of all the file names which need to be picked,right?lets call that file as FileNames.txt suppose this file has names of 5 files which need to be picked.where will all these 5 files be?will they be in same directory or different directories? what will be the naming convention?

now if u pick FileNames.txt via sender File adapter and want to deliver it to FTP then even via using Variable substitution you will be delivering FileNames.txt,not the 5 files whose names are inside.

if there is anything i m missing,please reply back

Thanx

Aamir

Former Member
0 Kudos

sorry..

you are right. I dont have files but just file names.

Thanks,

Beena.