Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
RAJ6
Contributor III

ERROR SHOWING LIKE "Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \ )"

 I am getting the following error

"Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \ )"  

0683p000009LwCt.png

I don't know how to handle that error.

Labels (2)
1 Solution

Accepted Solutions
cterenzi
Specialist

One of your components contains a string with a \ character. That is used as an escape character in Java strings. If you want a literal \ in your string, you need to escape the escape character and type \\

View solution in original post

5 Replies
Anonymous
Not applicable

Hello,

When you get some compile errors, please check your "Code" tab in your job. There will be your compile error highlighted in red line.

Best regards

Sabrina

cterenzi
Specialist

One of your components contains a string with a \ character. That is used as an escape character in Java strings. If you want a literal \ in your string, you need to escape the escape character and type \\
Anonymous
Not applicable

 {" +
" \"id\": \"DEV_A2_001\"," +
" \"value\": \"The device plugs into the vehicle's diagnostics port for your vehicle, which is typically under the dashboard on the driver's side.\\Some vehicles have the diagnostics port access in unusual spots. Find your vehicle's port location.\\If you still have difficulty locating your vehicle's diagnostics port or installing your device, please call the customer team at 877-389-0047.\"," +
" \"formatType\": \"text/plain\"," +
" \"encoding\": \"UTF8\"," +
" \"tagName\": \"\"" +
" }"

My code is also showing the same error...can you elaborate how to deal with invalid escape sequence....I saw your answer..but still confused..plzz hep
Anonymous
Not applicable

As it is said above escape the escape character. i had the same error but got it resolved.

 

e,g: "C:\Users\tr5677\Desktop" if this is your output path.

change it to 

 

"C:\\Users\\tr5677\\Desktop".

 

error was gone after this.

Anonymous
Not applicable

Team,

 

I'm new to Talend and struggling with a similar error. Hope someone would help me. I'm setting an Implicit tContext for a job. The environment is windows.

When I run the job, I get theerror message (see error.png.)

I then changed the path to  "C:\\TCTC_Course_Data\\Input\\tContextLoad_dev_conn.csv" and still get the below error.

Exception in component Implicit_Context_Regex (Implicit_Context_Load)
java.util.regex.PatternSyntaxException: Unclosed character class near index 11
^([^]*)(.*)$
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.clazz(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.group0(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at amit.implicit_context_load_0_1.Implicit_Context_Load.Implicit_Context_RegexProcess(Implicit_Context_Load.java:649)
at amit.implicit_context_load_0_1.Implicit_Context_Load.runJobInTOS(Implicit_Context_Load.java:2066)
at amit.implicit_context_load_0_1.Implicit_Context_Load.main(Implicit_Context_Load.java:1911)

 

Any help?

 


error message.png