Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data something like below, and i need to remove last folder/filename from the path and create a new field.
Can anyone help me what functions i need to use here... path depth is not constant here.
Path |
c:\windows\system32\wercplsupport.dll |
C:\Windows\System32\Tasks\WPD\SqmUpload_S-1-5-21-3480950271-2841014456-3714682224-1000 |
C:\Windows\System32\Tasks\UpdaterEX |
C:\Windows\system32\tasks\PrintProjects Communicator |
C:\Windows\system32\tasks\PrintProjects Communicator |
C:\Windows\System32\Tasks\ParetoLogic Registration3 |
C:\Windows\system32\tasks\CorelUpdateHelperTaskCore |
C:\Windows\system32\tasks\CorelUpdateHelperTaskCore |
c:\windows\system32\rundll32.exe |
c:\windows\system32\rundll32.exe |
c:\windows\system32\rundll32.exe |
c:\windows\system32\provsvc.dll |
c:\windows\system32\prodad-codec.dll |
c:\windows\system32\es.dll |
c:\windows\system32\drivers\swdumon.sys |
C:\Windows\Prefetch\WPWIN18.EXE-4760BC11.pf |
C:\Windows\Prefetch\PRINTSERVER180.EXE-FF650BD4.pf |
C:\Windows\Prefetch\NASVC.EXE-1366244C.pf |
C:\Windows\Prefetch\EXPLORER.EXE-A80E4F97.pf |
C:\Windows\Prefetch\COMMUNICATOR.EXE-B68D51A3.pf |
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\WordPerfect Office X8\Presentations Graphics X8.lnk |
|user_1|\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Newegg Download Manager\NeweggDownloadManager.lnk |
Like this:
Left(fieldname, Index(fieldname, '\', -1) - 1) as RemainingPath,
Index with a -ve start searches backwards from the end of the string.
Try this:
=SubField(Path,'\',substringcount(Path,'\')+1)
Thank you, actually it is giving result of last folder.
But i would like to create a new field where it exclude last folder and gives remaining path.
Like this:
Left(fieldname, Index(fieldname, '\', -1) - 1) as RemainingPath,
Index with a -ve start searches backwards from the end of the string.
Try like:
=Left('YourString',index('YourString','\',-1))
As you want to remove, it would be better to do so:
Left(Path,
index(Path,
SubField(Path,'\',substringcount(Path,'\')+1))-1)