Five Stars

recursive escape sequence

Hi,

I have a context variable for an input directory defined like so:

input_dir = d:\\ref_data\input\

 

This context variable is used by other components such as tFileList, tFileCopy etc. I have hit a problem with this:

Talend is reading the value of this context variable as(in words) - letter D, followed by colon, followed by backslash-r, now backslash-r or \r is the Java escape sequence for carriage return, so if I print out my context variable, the output is:

d:<blank spaces                                                                                                                                                                      >

ef_data\input. So it seems that after \\ is interpreted to mean a single backslash, that single backslash is then combined with r to create \r. Instead , I do not want to escape r, r should be taken literally as it is. How do I go about this.

 

Strangely, I tried the java filename format d:/ref_data/input, that only works in Talend Data Fabric Studio, once scheduled in Talend Administration Center, that doesn't work anymore as it seems TAC is expecting the Windows/DOS filenames.

 

Thanks.

 

 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Employee

Re: recursive escape sequence

In Java \ is a control character. You need to escape it with another \

C:\\\\refdata\\somefolder

In Talend / should work as well. Where in TAC is / not working. Can you put screenshots, logs etc?
1 REPLY
Employee

Re: recursive escape sequence

In Java \ is a control character. You need to escape it with another \

C:\\\\refdata\\somefolder

In Talend / should work as well. Where in TAC is / not working. Can you put screenshots, logs etc?