Escaping Strings

Company news, product updates, and practical articles from DB Software Laboratory.

Advanced ETL Processor
4.9 ★★★★★ Based on 16 reviews on Capterra See all reviews on Capterra →

Use string escaping when quotes, line breaks, slashes, or other special characters must stay inside a field without breaking the import. In Advanced ETL Processor, handle it as a data transformation step: escape the value, replace unwanted characters, and keep the useful text intact. Otherwise one notes field with a surprise line break can turn a tidy workflow into a small data plumbing incident.

What is "Escaping strings"?

Escaping a string means to reduce ambiguity in quotes (and other characters) used in that string. For instance, when you're defining a string, you typically surround it in either double quotes or single quotes:

"Hello, World."

But what if the string had double quotes within it?

"Hello "World.""

Now we have ambiguity - the software doesn't know where my string ends. one solution is to use single quotes around the string:

'Hello "World."'

Or I can escape my quotes:

"Hello \"World.\""

Any quote that is preceded by a slash is escaped and understood to be part of the value of the string.

Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called "escape sequences." To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences. An escape sequence is regarded as a single character and is therefore valid as a character constant.

Escape Sequences

Escape SequenceRepresents
\aBell (alert)
\bBackspace
\fFormfeed
\nNewline
\rCarriage return
\tHorizontal tab
\vVertical tab
\'Single quotation mark
\"Double quotation mark
\\Backslash
\?Literal question mark
\,Comma

Using escape Escape Sequences in Visual Importer

In Visual Importer we can use integrated language to correct the data:

begin
Result:=Replace(EscapeString(F001),'\n','');
end
Using Escape Sequences in Advanced ETL Processor

Here we can just escape string and replace the data

Escape Strings

or we can use replace characters function

Escape Strings

Next step

See the related product page for current features, editions, and trial downloads.

Direct link, no registration required.