LogoLogo
2.3.1
2.3.1
  • Introduction
  • Getting started
    • Installation
      • On-premises
      • Azure Market Place
      • AWS Market Place
    • Concepts
      • Datadate
      • Datasets
      • Program directory
      • Home directory
      • RDFs
      • Accounts
      • Services
    • Configuration
      • Data Sources
        • Extractors
        • Transformers
      • Catalogue
        • Adjustments
        • Rates
        • Services
      • Administration
        • Configuration
        • Users Groups
        • Workflows
    • Tutorials
      • Amazon AWS CUR
      • Azure EA
      • Azure CSP
      • Azure Stack
    • Releases
      • Upgrading to version 2
      • Archive
  • Diving deeper
    • Extract
      • Templates
      • Script basics
      • Parslets
      • Language
        • aws_sign_string
        • basename
        • buffer
        • csv
        • clear
        • discard
        • encode
        • encrypt
        • escape
        • exit_loop
        • foreach
        • get_last_day_of
        • gosub
        • gunzip
        • hash
        • http
        • if
        • json
        • loglevel
        • loop
        • match
        • pause
        • print
        • return
        • save
        • set
        • subroutine
        • terminate
        • unzip
        • uri
        • var
    • Transform
      • Language
        • aggregate
        • append
        • calculate
        • capitalise
        • convert
        • copy
        • correlate
        • create
        • default
        • delete
        • export
        • finish
        • if
        • import
        • include
        • lowercase
        • normalise
        • option
        • rename
        • replace
        • round
        • service
        • services
        • set
        • split
        • terminate
        • timecolumns
        • timerender
        • timestamp
        • update_service
        • uppercase
        • var
        • where
    • Report
      • Defining reports
      • Accounts
      • Services
      • Summary
    • Integrate
      • API docs
      • GUI automation
        • Examples
      • Single Sign On
        • Azure-AD
        • Auth0
Powered by GitBook
On this page
  • Syntax
  • Details
  • Example

Was this helpful?

Export as PDF
  1. Diving deeper
  2. Extract
  3. Language

escape

The escape statement is used to escape quotes in a variable value or the contents of a named buffer

Syntax

escape quotes invarName|{bufferName}

Details

If a variable value or named buffer contains quotes then it may be desirable to escape them, either for display purposes (to prevent USE from removing them before rendering the data as output) or in order to satisfy the requirements of an external API.

The escape statement will precede all occurrances of the character " with a backslash as shown in the example below. This operation is not just temporary - it will update the actual contents of the variable or named buffer.

The escape statement does not consider the context of any existing quotes in the data. Running it multiple times against the same data will add an additional escape character each time to each occurrence of a quote.

Example

Given an input file called 'escapeme.txt' containing the following data:

"this "is some text" with
some "quotes" in it"

The following script:

buffer test = FILE system/extracted/escapeme.txt
escape quotes in {test}
print {test}

var testvar = "\"This is \"a test\" string\""
escape quotes in testvar
print ${testvar}

will produce the following output:

\"this \"is some text\" with
some \"quotes\" in it\"

\"This is \"a test\" string\"
PreviousencryptNextexit_loop

Last updated 6 years ago

Was this helpful?