Dynamic data import / export

datenbank

simply more productive
Up to 10,000 records can be processed with the freeware version!
Welcome, Guest
Username: Password: Remember me
Welcome to the FlowHeater support forum.

Questions about using FlowHeater are answered here.

TOPIC: get current read filename

get current read filename 3 years 7 months ago #2279

  • FlowHeater-Team
  • FlowHeater-Team's Avatar
  • Offline
  • Administrator
  • Posts: 240
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 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 [b]Request via email[/b][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.
The administrator has disabled public write access.

Re:get current read filename 3 years 7 months ago #2280

  • FlowHeater-Team
  • FlowHeater-Team's Avatar
  • Offline
  • Administrator
  • Posts: 240
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.
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.
The administrator has disabled public write access.
Moderators: FlowHeater-Team
Time to create page: 0.069 seconds