0

I am working on a SSIS project that involves unzipping a folder which when extracted contains multiple text files in the same directory using a ForEachLoop Container. each file will have a different Name.

I have two variables of which variable 2 has an expression

Variable 1
name = zipfileName 
Value= sample.zip

variable 2
name = FileName 
value = *.* 
Expression = REPLACE(@[User::ZipFileName],".zip",".txt")

I need clarification concerning the expression part

My thinking is that this expression means the name of the zipfile is replaced with .txt extension when extracted? I also would like to know how it dynamically changes fileNames in runtime seeing as there are multiple files

thanks

anchor
  • 1,685
  • 2
  • 11
  • 11

1 Answers1

0

From what I can see, the Expression is replacing .zip for .txt in [User::ZipFileName]

If the value of [User::ZipFileName] is somefile.zip

the output would be:

somefile.txt
Pedro Lobito
  • 94,083
  • 31
  • 258
  • 268
  • Thanks Pedro , Do you have any idea how it caters for picking a different file name every time since there are multiple files to run through? – anchor May 14 '15 at 11:49
  • I'm not sure if I understood well your comment, `[User::ZipFileName]` seems to be a variable, so, it should change on every interaction. – Pedro Lobito May 14 '15 at 12:05
  • what I mean is lets say I have 3 of these text files as in abc.txt , def.txt and ghi.txt. The files will contain two columns ClientID and FileName e.g abc.txt .My question is how do I retrieve the filename part for each interaction and place it in the DB? – anchor May 15 '15 at 07:34