Help with SED

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Help with SED

#16 Post by Squashman » 31 Mar 2014 07:36

ferrad wrote:
Squashman wrote:

Code: Select all

 dir /AL /B /s


This doesn't show where they are pointing to.


This gets it down to the base path the junction is pointing to.

Code: Select all

for /f "tokens=2 delims=[]" %%G in ('dir /al ^|find /i "junction"') do echo %%G

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Help with SED

#17 Post by foxidrive » 31 Mar 2014 07:37

ferrad, it would help to show the command that you use to get the junctions as you have in your sample.

Did you note my recent post with a simpler sed solution?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Help with SED

#18 Post by Squashman » 31 Mar 2014 07:37

ferrad wrote:
Squashman wrote:Is this actually in your listing?
\??\

I don't see any of my junction points coming out like that at all.


Yes that's how it shows in Windows 7

I am on Windows 7. None of my Junctions show like that.

ferrad
Posts: 13
Joined: 28 Mar 2014 02:20

Re: Help with SED

#19 Post by ferrad » 31 Mar 2014 07:45

foxidrive wrote:This does it in GnuSED

Code: Select all

sed "s/.*:.[^\]*.\(.*\)\\.*/\1/"


This works great thanks.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Help with SED

#20 Post by Squashman » 31 Mar 2014 07:53

Pure batch.

Code: Select all

for /f "tokens=4,5 delims=\?[]" %%G in ("31/03/2014 12:07 <JUNCTION> BOPVT [\??\d:\ReOTech\Dev\TechRefactoring\BOPVT]") do set var1=%%G\%%H

Post Reply