Author |
Topic |
Kurmanc
Yak Posting Veteran
92 Posts |
Posted - 2008-12-02 : 08:37:52
|
Hi,I read a great article on http://www.mssqltips.com/tip.asp?tip=1084 but I did not figure out how to solve my problem after reading it. The thing is that a recieve a file to a destination folder irregularly. This file always starts with MA, so the file could be named MA3311335 or MA3251725, and so on. No logical name. I use SQL Server 2005 and I am not sure if regular expressions exists for Business Intelligence on SQL 2005?Is there any way to make the package read all files in that folder starting with "MA" ?This will not solve the problem: @[User::Filepath] + "MA"Any ideas? |
|
Kurmanc
Yak Posting Veteran
92 Posts |
Posted - 2008-12-02 : 08:50:50
|
I know there is another way to get around my problem by using Script Task but I am not allowed to use xp_cmdshell.Still any tips? |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-02 : 09:25:20
|
quote: Originally posted by Kurmanc Hi,I read a great article on http://www.mssqltips.com/tip.asp?tip=1084 but I did not figure out how to solve my problem after reading it. The thing is that a recieve a file to a destination folder irregularly. This file always starts with MA, so the file could be named MA3311335 or MA3251725, and so on. No logical name. I use SQL Server 2005 and I am not sure if regular expressions exists for Business Intelligence on SQL 2005?Is there any way to make the package read all files in that folder starting with "MA" ?This will not solve the problem: @[User::Filepath] + "MA"Any ideas?
you can do this by means of for each file enumerator. see belowhttp://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspxfor checking part just use a conditional task. |
 |
|
Kurmanc
Yak Posting Veteran
92 Posts |
Posted - 2008-12-02 : 10:14:30
|
Hi visakh16,I really appreciate your answer, thanks a lot. But I wonder where and how you set this "conditional task"? Could you perhaps show me an example?Best regards |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-02 : 10:51:18
|
He means setting filename to ma*.* instead of just *.* E 12°55'05.63"N 56°04'39.26" |
 |
|
Kurmanc
Yak Posting Veteran
92 Posts |
Posted - 2008-12-02 : 11:00:37
|
Peso, I will try this later on, thanks a lot! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-02 : 11:24:08
|
quote: Originally posted by Kurmanc Hi visakh16,I really appreciate your answer, thanks a lot. But I wonder where and how you set this "conditional task"? Could you perhaps show me an example?Best regards
Inside the for each loop use a conditional task to check if folder name variable's value is like 'MA%' |
 |
|
Kurmanc
Yak Posting Veteran
92 Posts |
Posted - 2008-12-03 : 08:21:17
|
Hi guys,It works perfectly. What I did was to make it loop through all files in the folder having files set to MA*.*Thanks for your time,Best regards! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-03 : 09:39:23
|
quote: Originally posted by Kurmanc Hi guys,It works perfectly. What I did was to make it loop through all files in the folder having files set to MA*.*Thanks for your time,Best regards!
Welcome |
 |
|
|