FlowHeater - The Data Import / Export Specialist
See also the general examples available, which may answer your question: Hello World 1 / 2 / 3 , format numbers as character strings , simple If-Then-Else , complex If-Then-ElseIf , filtering and grouping data , consolidate grouped values

get current read filename

  • FlowHeater-Team
  • Topic Author
  • Offline
  • Administrator
  • Administrator
More
9 years 9 months ago #2279 by FlowHeater-Team
get current read filename was created by FlowHeater-Team
Hi,

I very often need to use parts of the current input filename inside the logic of the transformation. Mostly the file might actually contain a date that has some significance and that I would need to parse out and use in the output. I assumed maybe a "global" parameter to be available (since I am calling via the Batch interface and I use the //ReadFileName [file] command line to pass in the file I need to process). Is this ReadFileName visible somehow, to be used? And if yes - could you maybe give a quick explanation?

Thank you.
Heinz
Request via email

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

Please Log in or Create an account to join the conversation.

  • FlowHeater-Team
  • Topic Author
  • Offline
  • Administrator
  • Administrator
More
9 years 9 months ago #2280 by FlowHeater-Team
Replied by FlowHeater-Team on topic Re:get current read filename
Hello Heinz,

For obtaining the current READ file name into the transformation you need the help of the .NET Script Heater and the little script below.
Code:
public object DoWork() { // get access to the READ TextFile Adapter TextFileAdapter adapter = (TextFileAdapter)AdapterRead; // return the filename for further processing return adapter.Filename; }

You have to move just one .NET Script Heater on the Designer. Double-click on the Heater and replace the default script with the Script above. The .NET Script Heater returns now the current file name.

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.337 seconds

other Languages

de

FlowHeater Home

de en

Imprint/Contact

Privacy Statement

Copyright © 2009-2023 by FlowHeater GmbH.
All rights reserved.

Follow us on

twitter  facebook

YouTube

 de en