Filename without extension
Posted: Wed Nov 05, 2014 5:20 pm
Hi,
How can I copy file name from each line and paste it at the beginning of the line with regular expression. For example, I have directory file listing as follows:
C:\Users\abcxyz\Documents\Default.rdp
C:\Users\abcxyz\Documents\desktop.ini
C:\Users\abcxyz\Documents\LotusInstall.log
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 1.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 2.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 3.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 4.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\faxed.gif
and the new listing should look like this:
Default-C:\Users\abcxyz\Documents\Default.rdp
desktop-C:\Users\abcxyz\Documents\desktop.ini
LotusInstall-C:\Users\abcxyz\Documents\LotusInstall.log
Fax 1-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 1.efx
Fax 2-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 2.efx
Fax 3-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 3.efx
Fax 4-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 4.efx
faxed-C:\Users\abcxyz\Documents\eFax Messenger 4.4\faxed.gif
Basically, I need to copy a string from the last backward slash "\" to the last dot "." and paste at the beginning of each line.
Any insight is really appreciated.
Thanks Guys.
How can I copy file name from each line and paste it at the beginning of the line with regular expression. For example, I have directory file listing as follows:
C:\Users\abcxyz\Documents\Default.rdp
C:\Users\abcxyz\Documents\desktop.ini
C:\Users\abcxyz\Documents\LotusInstall.log
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 1.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 2.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 3.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 4.efx
C:\Users\abcxyz\Documents\eFax Messenger 4.4\faxed.gif
and the new listing should look like this:
Default-C:\Users\abcxyz\Documents\Default.rdp
desktop-C:\Users\abcxyz\Documents\desktop.ini
LotusInstall-C:\Users\abcxyz\Documents\LotusInstall.log
Fax 1-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 1.efx
Fax 2-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 2.efx
Fax 3-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 3.efx
Fax 4-C:\Users\abcxyz\Documents\eFax Messenger 4.4\Fax 4.efx
faxed-C:\Users\abcxyz\Documents\eFax Messenger 4.4\faxed.gif
Basically, I need to copy a string from the last backward slash "\" to the last dot "." and paste at the beginning of each line.
Any insight is really appreciated.
Thanks Guys.