There are scenarios where we want to read files from a path such as \\tsclient\Z\Foreign workers\Contracts
. However, for most programming languages — including JavaScript —, a single backslash is used to denote an escape character, such as \n, \t, \f, etc.
In this article, we show you how to specify paths such as \\tsclient\Z\Foreign workers\Contracts
in the "Calculate a value" parameter of an activity.
Instructions
Using double backslashes
To specify a backslash (\) in the "Calculate a value" parameter, we need to prefix it with another backslash. So, the result is \\.
If you need to specify two backslashes as in the path \\tsclient
then you need to prefix each backslash in the path with a backslash as \\\\tsclient
.
Here is an example. Let's say that we need to fill the "Calculate a value" parameter with the path
\\tsclient\Z\Foreign workers\Contracts
Considering the instructions above, the resulting value must be:
\\\\tsclient\\Z\\Foreign workers\\Contracts
.
Using normal slashes
As an alternative, we can also use a normal slash (/).
For example:
"C:\\Exch\\" + expDate + ".csv"
"C:/Exch/" + expDate + ".csv"