FlowHeater Logo

FlowHeater Support Forum

simply more productive

Download the freeware version (10 Mb)

Up to 100,000 records can be processed with the freeware version!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Excluding Field

Excluding Field 5 years 11 months ago #2240

  • Herbert Berkley
  • Herbert Berkley's Avatar Topic Author
  • Offline
  • Posts: 15
I am using some code that creates a file name based on a field.. It also includes that field into the file being created. I use the unique field for each file but I don't want to throw it into the created file..

Here is my code..
public object DoWork()
if (InValues.Length != 2)
throw new Exception("2 Inputparameter expected!");

// get the TextFile Adapter from the WRITE side
TextFileAdapter adapter = (TextFileAdapter)AdapterWrite;

// Build the new filename using the InvoiceNumber = second input parameter
string filename = (string)InValues[1].GetString();
if (filename == null)
throw new Exception("not a valid invoice number!");

filename += ".txt"; // you can changes the ending by yourself

// set new file name on the WRITE side
adapter.Filename = filename;

// return the first input parameter for further processing
return InValues[0].GetValue();

I have attached an image file that shows the first number in the sequence, invoice number, that needs to be left out when generating each individual file.

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

Re:Excluding Field 5 years 11 months ago #2241

Hi Herbert,

You do not need a script for this anymore. With the help of Parameters this is quite simple.

You just need one String Append Heater to build the dynamic export file name and one Set Parameter Heater to set the Parameter "$Filename$" to this new value.
On the WRITE side you have to set the export file name to $Filename$ that’s all.

You can find a brief example in the attachment.

Attachment dynamic_filename_with_parameter.zip not found


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

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.
  • Page:
  • 1
Time to create page: 0.168 seconds