SSIS remove _datetimestamp from .txt file

dinesh 41 Reputation points
2022-10-08T03:26:21.827+00:00

Hi, I would like to import xyz_abc_12346_09262022.txt into DB. This 09262022"" part is date part and it will change daily. How do I ignore this 09262022 (date part) while importing?

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,467 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 33,551 Reputation points
    2022-10-10T02:37:27.747+00:00

    Hi @dinesh ,

    You may use substring to do that since you know the exact length of the full filename.

    SUBSTRING ("xyz_abc_12346_09262022.txt",1,7)+".txt"  
    SUBSTRING ([yourfilename],1,7)+".txt"  
    

    248670-image.png

    Or you may try with C# said here ssis-script-to-remove-date-from-file-name.

    Regards´╝î

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. dinesh 41 Reputation points
    2022-10-10T02:45:37.76+00:00

    But while importing into DB this will fail because of filename not found, right?