Hello,
I am using a very strange way to set the Bots outputfilename, and I want to change this. The existing Threads about filenames didn't help me either (or maybe I didn't search correct).
This is my requirement: Use Fields out of the Input or Output file as part of my filename.
This is how I changed my mapping-script:
# testindicator is a variable field used to give the output name
out.ta_info['testindicator'] = '%s|%s|%s' % (value1, value2, value3)
This is my communicationscript:
import time
def main(channeldict,filename):
return true
# Name the output file using partner names
# channel must include "*" in filename
# syntax must contain 'merge':False
def filename(channeldict,ta,filename):
# fetch the attributes of ta-object
ta.syn('frompartner')
ta.syn('testindicator')
# the fetched attributes can be accesed with "ta.[attributename]" now
if ta.testindicator :
# get values out of testindicator. testindicator is filled in the mapping script.
value1 = ta.testindicator.split('|')[0]
value2 = ta.testindicator.split('|')[1]
value3 = ta.testindicator.split('|')[2]
# return filename
return channeldict['filename'].replace('*', value1 + '_' + value2 + '_' + value3 + '_' + time.strftime('%Y%m%d'))
else:
return filename
How is this issue solved usually? I don't think that testindicator was a good idea for me.
Kind regards,
Dominik Müller