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: Preventing empty lines in a text file export

Preventing empty lines in a text file export 5 years 6 months ago #2114

  • FlowHeater-Team
  • FlowHeater-Team's Avatar
  • Offline
  • Administrator
  • Posts: 240
Translated submission in the German forum. You can read the original entry here.

Hi everybody,

Maybe I'm trying to run before I can walk...

I receive a CSV export file with ';' separators and of 100 lines. The export file is always 100 lines long, even if only 20 of the lines contain data.

I've attempted using the If-Then and Filter functions, with a >0 condition to eliminate the empty lines, so that I don’t end up with 80 empty lines of ';;;;;;;'. The Filter shows a counter field, prior to which a 'Trim Start' is inserted, so that any leading white space characters are eliminated.

Am I trying to do this the wrong way?

Roland
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:Preventing empty lines in a text file export 5 years 6 months ago #2115

  • FlowHeater-Team
  • FlowHeater-Team's Avatar
  • Offline
  • Administrator
  • Posts: 240
Hello Roland,

In addition drag a String Append Heater onto the Designer window and connect to the input of the Heater all the CSV fields on the READ side that could possibly be empty. Then pass the output through a Trim Heater. The result of this you can now easily test with a IF-Then-Else condition comparing it with an empty string (see note further below), this supplies the correct input for the boolean (=TRUE) required by the Filter Heater.

If all the CSV fields are empty or contain white space, the String Append Heater concatenates a string of only white space. The Trim Heater eliminates all the white space at the beginning and end of a string. If there was only white space in the concatenated string, the string length now becomes 0. The string length is tested for zero in the If-Then-Else Heater and in this case returns TRUE. The Filter Heater then ignores the empty row, leaving only rows with actual data in the CSV export.

Tip: In order to directly compare with an empty string (a string of length 0), you only need to enter the single character "=" in the If-Then-Else Heater condition and click the Insert button. You do not need to enter an actual value. Alternatively, you could pass the result through a String Length Heater and enter "=0" in the If-Then-Else Heater condition.
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.071 seconds