- Posts: 13
Repeat field if empty
- Heinz
- Topic Author
- Offline
- User
Less
More
9 years 10 months ago #2347
by Heinz
Repeat field if empty - Post(2347) was created by Heinz
Hi there,
I have an input text file that has the following format (simplified for the question):
ID,F1,F2,F3
A,1,2,3
,3,4,5
,6,7,8
B,9,10,11
,12,13,14
The data is "grouped" by the ID field in the input (not sorted) and the blank ID field in a row means the data "belongs" to the last ID received. I want to generarte an output file with the ID in each row:
ID,F1,F2,F3
A,1,2,3
A,3,4,5
A,6,7,8
B,9,10,11
B,12,13,14
etc.
Hope this makes sense.
And on a related question - can I specify different filters for multiple output layers? You recently introduced the nice function of adding more than one write layer. But on the above example, I would want to generate 1 file for all the rows where ID is not blank and one file (in different format) with the details described in my question above.
i solve this for now by simply passing the file through 2 configs..
PS - as always, I am extremely happy with flowheater, its a great product!! Keep up the good work.
Heinz
I have an input text file that has the following format (simplified for the question):
ID,F1,F2,F3
A,1,2,3
,3,4,5
,6,7,8
B,9,10,11
,12,13,14
The data is "grouped" by the ID field in the input (not sorted) and the blank ID field in a row means the data "belongs" to the last ID received. I want to generarte an output file with the ID in each row:
ID,F1,F2,F3
A,1,2,3
A,3,4,5
A,6,7,8
B,9,10,11
B,12,13,14
etc.
Hope this makes sense.
And on a related question - can I specify different filters for multiple output layers? You recently introduced the nice function of adding more than one write layer. But on the above example, I would want to generate 1 file for all the rows where ID is not blank and one file (in different format) with the details described in my question above.
i solve this for now by simply passing the file through 2 configs..
PS - as always, I am extremely happy with flowheater, its a great product!! Keep up the good work.
Heinz
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
9 years 10 months ago #2348
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Repeat field if empty - Post(2348)
Hello Heinz,
This can be done very easy with the power if FlowHeater Parameters and one IF-THEN-ELSE Condition .
The IF-THEN-ELSE Condition checks whether the field “ID” is empty or not. In case the field content is not empty the FlowHeater Parameter “tempID” will be overridden by using the Set Parameter Heater with the current content. In case the field is empty the last value of the FlowHeater Parameter “tempID” will be used the value are retrieved by Get Parameter Heater .
In the attachment you’ll find a simple example.
Remark: I used the Parameter name “tempID” just to demonstrate that Parameter names are different to the Field names. You could of course use “ID” for the Parameter name as well.
Your second question: Currently this is not possible, your mentioned solution is the only way to implement such filters. But this feature is of course planned for a further version.
This can be done very easy with the power if FlowHeater Parameters and one IF-THEN-ELSE Condition .
The IF-THEN-ELSE Condition checks whether the field “ID” is empty or not. In case the field content is not empty the FlowHeater Parameter “tempID” will be overridden by using the Set Parameter Heater with the current content. In case the field is empty the last value of the FlowHeater Parameter “tempID” will be used the value are retrieved by Get Parameter Heater .
In the attachment you’ll find a simple example.
Remark: I used the Parameter name “tempID” just to demonstrate that Parameter names are different to the Field names. You could of course use “ID” for the Parameter name as well.
Your second question: Currently this is not possible, your mentioned solution is the only way to implement such filters. But this feature is of course planned for a further version.
Best wishes
Robert Stark
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.258 seconds