cancel
Showing results for 
Search instead for 
Did you mean: 

How to automatically move a file after data extraction is done

rajarshi_muhuri
Active Participant
0 Kudos

Hi

1. I have an excel file that needs to be moved automatically to a different folder , once the bods job has run on it .

For example move filename.xlsx to folder 'archive' ( maybe also put a timestamp)

2. my file name is april_filename.xlsx, may_filename.xlsx, june_filename.xlxs

, how do i make BODS to pick up based on the word 'filename' only and ignore the months prefix .

Thanks in advance

rishi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Write a .bat file to archive the files. Attach a script at the end of the dataflow. Inside the script write exec() to call the .bat file.

Arun

Answers (1)

Answers (1)

Former Member
0 Kudos

I have a solution that can be adapted to your needs but it is not owned by me so I cannot share it all together.

I will give you the idea of what functions and mechanisms you could use. I hope it's hopeful.

Please use variables for this to be adapted properly.

I suggest you use a receipt table where you would insert names of the file caught by next processes and prepared table where you would already have the naming files.

wait_for_file() which uses file location, filenamelist and listsize.

You need to build the list and substract one by one the filenames and perform individual inserts into the receipt table.

After you have build your receipt table match with what you have in the already prepared table and start processing file by file.

Moving files around is done by

exec('cmd','move "[$FileReceiptLocation][\[$FileName]"  "[$TargetLocation][$FileName]"',1);

You can create custom functions that can execute these exec commands with parameters.

Best of luck,

Bogdan

rajarshi_muhuri
Active Participant
0 Kudos

Thanks , seems a very complicated . So avoided the approach just to make life easier