Skip to main content
simply more productive

The Data Specialist

Thanks to our intuitive transformation designer, you can convert data effortlessly to a variety of formats without knowing how to program. It’s not only efficient, it’s also easy to use.
Up to 100,000 records can be processed with the freeware version!
Flowheater Chart

get current read filename

  • FlowHeater-Team
  • avatar Topic Author
  • Offline
  • Admin
  • Admin
More
11 years 8 months ago #2279 by FlowHeater-Team
get current read filename - Post(2279) 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

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

  • FlowHeater-Team
  • avatar Topic Author
  • Offline
  • Admin
  • Admin
More
11 years 8 months ago #2280 by FlowHeater-Team
Replied by FlowHeater-Team on topic Re:get current read filename - Post(2280)
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

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

Time to create page: 0.249 seconds
FlowHeater Logo

FlowHeater - The Data Specialist

Efficient data integration and transformation with FlowHeater – the perfect solution for a seamless transfer of your data.

Legal information

Support & Contact

Contact

Phone:
0951 / 9933 9792

eMail:
This email address is being protected from spambots. You need JavaScript enabled to view it.


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