Replace Character object not working properly

More
5 years 6 months ago #20730 by StanBlue
I'm using the Replace Character object in a transformer to break up addresses that are using new lines and replace those new lines with commas.
On my first attempt, I was listing several different potential line terminators and breaks (including new line, carriage return, vertical tab, tab, space); all to be replaced by a comma. AETLE would catch some of these, but not all. But in the exported text file, rather than a comma + space, these line terminators and breaks would be replaced by numbers (either 2, or 5).
On my second attempt, I reduced the 'Search for:' list to just a new line to be replaced with a comma + space. After writing the text file, I saw that a comma + new line had been added.
What am I doing wrong here?
Also, I noticed that the Replace Characters object has been adding characters (usually some form of 'replace characters') to the 'Replace With:' window. Why would it do that?
Thanks!

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

More
5 years 6 months ago #20731 by admin
Please post screenshots

Mike
ETL Architect

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

More
5 years 6 months ago - 5 years 6 months ago #20733 by Maria
I have updated the wiki page to make it easier to understand.

www.etl-tools.com/wiki/advanced-etl-proc.../replace-characters/

Also, I noticed that the Replace Characters object has been adding characters (usually some form of 'replace characters') to the 'Replace With:' window. Why would it do that?

The string length of "Replace width" must be always equal or more to the length of "Search for"

Replace characters replaces multiple characters within the string

For example

Search for =ADBC
Replace width = 1234

A is replaced with 1, B is replaced with 2 D with 3 and C with 4
Last edit: 5 years 6 months ago by Maria.

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

More
5 years 6 months ago #20734 by StanBlue
Here are some screen shots of the Replace Character after closing Transformer (replace_before) and the addresses after exporting (address_first_attempt). Then change the Replace Character to only new line (replace_after), and the resulting addresses with new lines added (address_second_attempt)

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

More
5 years 6 months ago - 5 years 6 months ago #20735 by admin
Not sure I understand the issue here, "Replace character" transformation function replaces one character with another,
it does not replace the character with a string of characters.
For that, you need another function called "Replace"

Also If you have a look at the wiki page you will see that characters are placed horizontally but in your screenshot they are vertical

\n\r\v \t
,,,,,,

Mike
ETL Architect
Last edit: 5 years 6 months ago by admin.

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

More
5 years 6 months ago #20736 by admin
If it does not help provide us with your transformation and a source file

Mike
ETL Architect

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

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save