This gets the output you want by eliminating everything before the last common directory.
I have no idea where "ABC" enters into your example :(
#!/usr/bin/perl # https://perlmonks.org/?node_id=1217048 use strict; use warnings; local $_ = do { local $/; <DATA> }; /^(.*)\\.*\\.*\n(?:\1\\.*\\.*\n)*$/ and s/\Q$1\E//g; print; __DATA__ C:\somedirectory\anotherDirectory\WorkingDirectory\myFile.txt C:\somedirectory\anotherDirectory\WorkingDirectory\Logs\myLogs.txt C:\somedirectory\anotherDirectory\WorkingDirectory\Stuff\myStuff.txt
In reply to Re: Path parsing from full to relative
by tybalt89
in thread Path parsing from full to relative
by Kaplah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |