Re: for each file loop question on reading variables



OK

You can use the Scipt task to do this. I am not sure though what it is that you want to do. Is the thing that you want to do based on filename a control lfow thing or is it a data thing. This could affect the solution.

In the pipeline (data). You may want to look to add the variable into the pipeline as a column (Deried Column Transform) and then use the Condition Split transform to test the value therein and do something about it.

In the Control Flow you may want to use the Script task. You can lock the variable you want to examine on the Script node of the task custom UI and then within the task you can simply say something like

Dim s As String = Dts.Variables.Item("My Variable Name").Value.ToString()

If what you want to do is simply make a FF Connection Manager point to this new file then you need to look at property expressions. Highlight the Conection Manager, hit F4, ind the Expressions item and hit the ellipses. Choose the Connection String property on the left and then hit the ellipses on the right and drag the variable you want into the expression pane at the bottom

Looping over files with the Foreach Loop
(http://www.sqlis.com/55.aspx)

--


Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com



"news.microsoft.com" <simonwhale@xxxxxxxxxxxx> wrote in message news:OlFPld5SHHA.496@xxxxxxxxxxxxxxxxxxxx:

Hi,

i have use a script to read the filenames from a for each file loop, so
that
i can perform certain tasks depending on the filename.

does anyone know a good example that i can use?

Simon

.



Relevant Pages

  • Re: A script to flag commonly misused words
    ... is preferable in general as it allows you to scope warnings. ... use strict; ... I first wrote a script to extract the words to flag from your ... I discovered that at least one of the expressions you ...
    (comp.lang.perl.misc)
  • Re: using xml to save/open project data
    ... http://www.TransProCalc.org - Free translation project mgmt software ... set filename tk_getOpenfile ... Exec'ing the script you run it as a separate process, your script won't be able to access its vars. ... generating the xml file is easy enough. ...
    (comp.lang.tcl)
  • Re: Help me find 5 mistakes and than solution to thoes mistakes!
    ... > 8:# This script will create links to files from all of the filename ... > 10:# arguments provided on stdin if no filenames provided on command ...
    (Fedora)
  • Re: MIME - scripting and symbol substitutions
    ... This script is creating a text file with a different filename ... symbol called NEWFILENAME (which works, ... MIME from the command line with all options (so normal DCL ...
    (comp.os.vms)
  • Re: virtual server backups
    ... Here is the script. ... 'Save state the virtual machine ... Filename = MyArray) ... Set objVM = Nothing ...
    (microsoft.public.windows.server.general)