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.
Flowheater Download

Removal of unprintable characters

  • FlowHeater-Team
  • Topic Author
  • Offline
  • Admin
  • Admin
More
13 years 3 months ago #2075 by FlowHeater-Team
Removal of unprintable characters was created by FlowHeater-Team
Translated submission in the German forum. You can read the original entry here .

Hi,

I regularly import Excel files which contain characters that cannot be printed. Is there some way to eliminate these with FlowHeater during an import? There is a "clean up" function in Excel, but due to the large number of rows, the use of this function is not practical for me.

Best regards,
Achim Federle

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.

Please Log in to join the conversation.

  • FlowHeater-Team
  • Topic Author
  • Offline
  • Admin
  • Admin
More
13 years 3 months ago #2076 by FlowHeater-Team
Replied by FlowHeater-Team on topic Re:Removal of unprintable characters
Hi Achim,

You can achieve this using the .NET Script Heater along with the script I have written below.

You have to drag a .NET Script Heater on the Designer window for each individual Excel field that could possibly contain unprintable characters. Then copy the script below into the Heater configuration and connect the incoming field to the .NET Script Heater as well as its output to the relevant field on the WRITE side.
This script filters the characters of the incoming string. I think it should work for the most frequently used characters.
Code:
public object DoWork() { object invalue = InValues[0].GetValue(); if (invalue == null) return invalue; string replace_with = ""; // = remove from string // string replace_with = " "; // = replace with space // add additional characters here string special_character= "\t\n\r\\[\\]!ß´#\"$§%&' ()*+€,-./:;<=>?@\\^_`{|}~"; Regex myRegex = new Regex(@"[^\w\d" + special_character + "]"); return myRegex.Replace((string)invalue, replace_with); }

At present it passes through:
- all letters and numbers
- most special characters (see comments in the script)

If some special characters are eliminated that should not be replaced/removed, you just need to add those characters to the list of special characters in the script, between the quote marks (see the comments in the script).

Note: This script makes use of regular expressions (Regex) and hence is only supported by FlowHeater versions 1.2.6 and above. For further information about this, please refer to the ReleaseNotes .

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.

Please Log in to join the conversation.

Time to create page: 0.296 seconds

FlowHeater - The Data Specialist

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

Rechtliches

Support & Contact

Kontaktinformation

Telefon:0951 / 99339792 E-Mail:This email address is being protected from spambots. You need JavaScript enabled to view it.

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