0

I'm using Edit Plus and have the following type of lines in a text file which represent a directory structure and a file.

\APPS\MCCSDOCS\GENERAL\10-11 ARRAT\BRIDGE RIVER_\BRIDGE RIVER-PA0900021_DEC 21.PDF
\APPS\MCCSDOCS\GENERAL\10-11 ARRAT\BURNS LAKE\BURNSLAKE_PA1100062-SE_MAR2010.XLS
\APPS\MCCSDOCS\GENERAL\10-11 ARRAT\CAMPBELL RIVER\CAMPBELLRIVER_PA0900004_ARRAT_OCT2010.PDF

What I need to do is grab the directory structure \APPS\MCCSDOCS\GENERAL\10-11 ARRAT\BRIDGE RIVER_\ and place it in buffer /1 and also grab the file name BRIDGE RIVER-PA0900021_DEC 21.PDF and place it in buffer /2.

If it is easier to start at the end of the line and grab the file name and then grab what is left, that would work too.

Jerry
  • 70,495
  • 13
  • 100
  • 144
Russ
  • 9
  • 2
  • Have you tried anything so far? And what do you mean by 'buffer'? Did you perhaps meant `\1` and `\2` instead of `/1` and `/2`? – Jerry Sep 24 '13 at 16:42
  • Have a look at the wiki papge (https://editplus.info/wiki/Regular_expression_syntax) and this tutorial (http://kedar.nitty-witty.com/blog/working-with-editplus-text-editor-regular-expression-how-to) – pengchy Jan 11 '20 at 07:41

2 Answers2

0
(\\.*\\.*\\.*\\.*\\.*\\)(.*)   

\\ = literal \
.* = anything 

The result will be:

\APPS\MCCSDOCS\GENERAL\10-11 ARRAT\BRIDGE RIVER_\=======BRIDGE RIVER-PA0900021_DEC 21.PDF
\APPS\MCCSDOCS\GENERAL\10-11 ARRAT\BURNS LAKE\=======BURNSLAKE_PA1100062-SE_MAR2010.XLS
\APPS\MCCSDOCS\GENERAL\10-11 ARRAT\CAMPBELL RIVER\=======CAMPBELLRIVER_PA0900004_ARRAT_OCT2010.PDF

Is this what you want?

enter image description here

ISQ
  • 2,704
  • 1
  • 14
  • 8
0
^[\s]*(.*\\)(.*\.[a-zA-Z]{3,5})[\s]*$

It seems this works in this case.

Added filename extension part \.[A-z]{3,5} and leading or trailing space checking part [\s]* of filepath string. Thanks:-)

Thm Lee
  • 1,236
  • 1
  • 9
  • 12