Replace function in SSIS Expression

  • hi,

    I have files that are coming in .txt files. Example  MA.textfile1.txt ,MA.textfile2.TXT . I need to replace the file name after i process these files.

    I have a foreach loop to get the file names , and file system task to rename files.

    However i have set up variables within file system task, if i find .txt in filename , use Replace function to convert it to .bak.

    However i figured out that REPALCE function is case senstive. Because my expression is something liek below.

    REPLACE(@USEFILENAME,".TXT",".BAK")

    SO, it converts only the file has .TXT in uppercase. If i come across file with lower case .txt it is not converting.

    Please suggest me the solution, if i can rewrite this expression , to just check .txt/.TXT file whether it is in lowercase or uppercase.

     

     

  • Just use REPLACE(UPPER(@USEFILENAME),".TXT",".BAK") then you don't need to worry about case.

  • Thanks. It worked.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply