Problem with backslash character \

Post Reply
Krzysztof Mycek
Member
Posts: 30
Joined: Tue Mar 03, 2020 11:28 am

Problem with backslash character \

Post by Krzysztof Mycek »

I have a question because I can’t find any information about my problem.
I need to separare part od path included in the XML file and metadata, witch is like for example: 0450-06-2021\karton.pdf. I need only part before \ character 0450-06-2021. Unfortunately when I use funcion Before \, this character is not recognized.
Do You have some idea how I can get only part before backslash?

My XML file is like:


<?xml version="1.0" encoding="UTF-8"?>
<Positions>
<Position>
<position_id>124519</position_id>
<order_id>25069</order_id>
<client_name/>
<width unit="cm">100.00</width>
<height unit="cm">100.00</height>
<surface_name>BACKLIT FLASH; 1800X2400;</surface_name>
<color_name>brak</color_name>
<printer_machine_name>FABRI</printer_machine_name>
<file_path root_path="\192.168.1.193\DTP2">0450-06-2021\karton.pdf</file_path>
</Position>
</Positions>
Attachments
Zrzut ekranu 2021-08-2 o 16.17.25.png
Zrzut ekranu 2021-08-2 o 16.17.25.png (93.11 KiB) Viewed 5962 times
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Problem with backslash character \

Post by jan_suhr »

Have you tried to escape it, \\
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Krzysztof Mycek
Member
Posts: 30
Joined: Tue Mar 03, 2020 11:28 am

Re: Problem with backslash character \

Post by Krzysztof Mycek »

Hi Jan
Unfortunately not working too. I try to use many combination.
Attachments
Zrzut ekranu 2021-08-2 o 16.31.29.png
Zrzut ekranu 2021-08-2 o 16.31.29.png (93.54 KiB) Viewed 5959 times
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Problem with backslash character \

Post by jan_suhr »

Then try \/
Switch can for paths "normalize" slashes to be working on both platforms.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Krzysztof Mycek
Member
Posts: 30
Joined: Tue Mar 03, 2020 11:28 am

Re: Problem with backslash character \

Post by Krzysztof Mycek »

Any combination not working.
\/ no
\\ no
// no
"\\" no
ect ect
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Problem with backslash character \

Post by jan_suhr »

In the search field you can use Regular expressions to pickup parts from your variable value. That way would probably solve the problem.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Krzysztof Mycek
Member
Posts: 30
Joined: Tue Mar 03, 2020 11:28 am

Re: Problem with backslash character \

Post by Krzysztof Mycek »

Maybe that is the solutions but a little complicated.
Thank You Jan. Maybe someone else will have an idea and face such a problem
Krzysztof Mycek
Member
Posts: 30
Joined: Tue Mar 03, 2020 11:28 am

Re: Problem with backslash character \

Post by Krzysztof Mycek »

That is the solution: ^(\d{4}[- ]\d{2}[- ]\d{4})|()$
Of course only for this case.
laurentd
Member
Posts: 137
Joined: Wed Mar 13, 2019 2:06 pm

Re: Problem with backslash character \

Post by laurentd »

Another solution: use the StringSplitter app with separator \
The result will be in private data Split.Part1
https://www.enfocus.com/en/appstore/pro ... ngsplitter
Laurent De Wilde, Solution Architect @ Enfocus
Post Reply