[英]Mirth originalFilename rename
I have been trying to remove .dat from ${originalFilename} in destination when i tried to do this ${originalFilename}.txt it gave me like 1652807798759.dat.txt how can i get 1652807798759.txt only without .dat in it当我尝试执行此 ${originalFilename}.txt 时,我一直试图从目的地的 ${originalFilename} 中删除.dat
I have tried to do this in Destination's Transformer but no luck我曾尝试在 Destination's Transformer 中这样做,但没有运气
channelMap.put('OrigFilename', sourceMap.get('originalFilename'));
var outFile = channelMap.get('OrigFilename');
logger.info('outFile ' + outFile ); // i am getting outFile as null here
//outFile=outFile.replace('.dat','');
A simple replace should work:一个简单的替换应该可以工作:
//test it with a static string first, in real code use sourceMap.get('originalFilename').toString();
var outFile = '1652807798759.dat.txt' ;
outFile = outFile.replace(/\.dat/g, "");
logger.info('outFile ' + outFile );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.