Extracting Numbers

A swapping-ground for Regular Expression syntax

Extracting Numbers

Postby danielhitch » Tue Apr 07, 2009 4:37 pm

Ok... Heres my problem...

I have a bunch of folders all with different lengths of names.

There is a 3 digit number on each of these folders ranging from 001-350.

Some folders also contain other numbers within their current names.

Is there a way I could just extract this 3 digit number and add a prefix??

If so, what functions do I use on BRU??

Thanks!!

Dan.
danielhitch
 
Posts: 2
Joined: Tue Sep 23, 2008 1:50 pm

Re: Extracting Numbers

Postby GMA » Wed Apr 08, 2009 10:07 pm

Hi, Dan:
A couple of questions:

- Are those three digits always at the begining of the folder names, or maybe sometimes in the middle, etc.?
- You say "extract this 3 digit number and add a prefix". You mean, as in "remove the 3 digits from the folder names and replace them with a prefix" or as in "copy the 3 digits from the folder names and add them as a prefix to the files inside each folder"?

Cheers,

Gabriel.
GMA
 
Posts: 91
Joined: Sun Dec 02, 2007 1:30 pm
Location: Argentina


Return to Regular Expressions