dateParts = searchedTimestamps.split("#")
            #we expect two parts index[0] should be either start or end
            if dateParts[0].lower() == "start":
                readWrapper.readRecordsWithTimeStamp(startDate=dateParts[1], endDate=None,
                                                     outDir=outDir, fileSize=args.fileSize,
                                                     countToRead=countToRead)
            elif dateParts[0].lower() == "end":
                readWrapper.readRecordsWithTimeStamp(startDate=None, endDate=dateParts[1],
                                                     outDir=outDir, fileSize=args.fileSize,
                                                     countToRead=countToRead)
        else:
            print "no date parameters are matching as start and/or end date - nothing is done"



    else:
        readWrapper.readRecords(rId=args.idToRead,countToRead=args.countToRead,
                                    fileSize=args.fileSize, outDir=args.outDir,condition=args.condition,
                                    inputFile=args.inputFile,
                                    userDatestamp=args.userDatestamp
                                )


except Exception as pythonBaseException:
    print str(pythonBaseException)

finally:
    if not readWrapper is None:
        readWrapper.closeResources()
    #print "process readOAIRecords has finished - look for possible errors"
            if dateParts[0].lower() == "start":
                readWrapper.readRecordsWithTimeStamp(startDate=dateParts[1], endDate=None,
                                                     outDir=outDir, fileSize=args.fileSize,
                                                     countToRead=countToRead)
            elif dateParts[0].lower() == "end":
                readWrapper.readRecordsWithTimeStamp(startDate=None, endDate=dateParts[1],
                                                     outDir=outDir, fileSize=args.fileSize,
                                                     countToRead=countToRead)
        else:
            print "no date parameters are matching as start and/or end date - nothing is done"



    else:
        readWrapper.readRecords(rId=args.idToRead,countToRead=args.countToRead,
                                    fileSize=args.fileSize, outDir=args.outDir,condition=args.condition,
                                    inputFile=args.inputFile,
                                    userDatestamp=args.userDatestamp,
                                    docRecordField=args.docRecordField,
                                    purgeDeleted=args.purgeDeleted
                                )


except Exception as pythonBaseException:
    print str(pythonBaseException)

finally:
    if not readWrapper is None:
        readWrapper.closeResources()
    #print "process readOAIRecords has finished - look for possible errors"
                                                     outDir=outDir,
                                                     fileSize=args.fileSize,
                                                     countToRead=countToRead)
            elif dateParts[0].lower() == "end":
                readWrapper.readRecordsWithTimeStamp(startDate=None,
                                                     endDate=dateParts[1],
                                                     outDir=outDir,
                                                     fileSize=args.fileSize,
                                                     countToRead=countToRead)
        else:
            print "no date parameters are matching as start and/or end date - nothing is done"

    else:
        readWrapper.readRecords(rId=args.idToRead,
                                countToRead=args.countToRead,
                                fileSize=args.fileSize,
                                outDir=args.outDir,
                                condition=args.condition,
                                inputFile=args.inputFile,
                                userDatestamp=args.userDatestamp,
                                docRecordField=args.docRecordField,
                                purgeDeleted=args.purgeDeleted)

except Exception as pythonBaseException:
    print str(pythonBaseException)

finally:
    if not readWrapper is None:
        readWrapper.closeResources()
    #print "process readOAIRecords has finished - look for possible errors"