Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Extract a word from path

$
0
0

HI everybody,

 

I try to extract a word from a path, such as

\\192.168.6.5\rawdata$\192.168.1.78\Proton1\14GS000674\14GS000674_14A00240-4_ODTRC_PRO-106_20140401190103.fasta

And that word I will use it in another variable.

I started with the following command $arrWord = Split-Path($line, "\")
But faced problems with the brackets with the command as they are not considered.

Do you have any idea/example on what I could use to extract the word "ODTRC" from the above link?

 

Thanks,


Viewing all articles
Browse latest Browse all 6937

Trending Articles