I have to do validation for a filename in jython .The code picks up a single file from a shared loacation and then i have to check it name against a database column value which i have stored in Odi variable.Can anyone please guide me as to how should i go about it.The dbase colum value is just a substring part of the filename value.How should i extract the filename and do comparision also i have to rename it if it doent match adding _err to it and move it to another directory.
the filnename doen't start with the odi variable..it is a part of the filename string
the odi variable contains the value either of the values PASS,CASS,DASS i have to compare this with the middle portion of filename.
Can you please guide me on this how can i do this
also which module should i import for string functions if i try using any string function it gives an error stating
AttributeError: instance of 'org.python.core.PyFile' has no attribute 'startswith' same haapens if i try and use str.find(substring)
Hi Bhabhani i still m facing a problem i have to read file from a shared directory in which file will be placed then have to do the name validation upon the file
mydir = "#Dir_Variable"
myInputDir = mydir + os.sep + 'Input'
myTransformedDir = mydir + os.sep + 'Transformed'
myErrorDir=mydir + os.sep + 'Error'
mylist = os.listdir(myInputDir)
for dirOrFile in mylist:
then do sumthing
place the file in another directory
but this is not working can you please guide me.
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('<string>', 27, 41, '\t\t\t\t\ttry:'))
and i get this error