actually i'm reading file in mirth connect>source transformer
, configuration is as you see in below image. There is file in D:\yash.txt
, and after reading i want to move them into same directly by placing _processed
suffix before .txt
file extension.
file read and processed okay,it generate filename like yash.txt_processed
, is there a way, i can give name like yash_processed.txt
, i don't want to give it directly, because i want that whenever i add file into drive, it automatically processed.
Any help is appreciated.
For your source connector create a JavaScript transformer step (click Edit Transformer) with the following code:
var srcFileName = sourceMap.get('originalFilename');
globalChannelMap.put('processedFile', srcFileName.replace(".", "_processed."));
Then, into the Move-To File Name: field place the newly created variable. So, instead of ${originalFilename}_processed
it should be ${processedFile}
Try it now.