Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hrolofs
Contributor III
Contributor III

Load inline with ] inside the data

Hello,

how i can use the ] character inside the data?

LOAD * INLINE [

    F1, F2

    test, "[test]"

];

Regards, Henry

4 Replies
Miguel_Angel_Baeyens

Hi Henry,

Try something like this:

Data:

LOAD F1, Replace(Replace(F2, '$<', '['), '>$', ']') AS F2 INLINE [

F1, F2

test, $<test>$

];

Yes, that means that you have to change the source characters, but it shouldn't be an issue since it's an INLINE (therefore hardcoded) table.

Hope that helps.

Miguel

hrolofs
Contributor III
Contributor III
Author

Hello Miguel,

thanks for your answer.

After i try to esacpe the ] character without success I found an other easy way:

LOAD * INLINE "

    F1, F2

    test, '[test]'

";

inline is used if data should be typed within the script, and not loaded from a file. Use the Inline Data Wizard for help with the creation of load inline statements.

data ::= [ text ]

Data entered through an inline clause must be enclosed by quotation marks or with square brackets. The text between these is interpreted in the same way as the content of a file. Hence, where you would insert a new line in a text file, you should also do it in the text of an inline clause, i.e. by pressing the <ENTER> key when typing the script.

Quotation marks

If quotation marks are possible or necessary within a statement, it is mentioned below. In a load statement the following symbols should be used as quotation marks:

Field names:

[ ] , " " , ` ` or ´ ´

String literals:

' '

Miguel_Angel_Baeyens

Yep,

That one is far easier!

Miguel

Not applicable

What is the format to use when the inline data contains an apostrophe?  Neither doubling the single quote nor adding a preceding backslash worked for me.