Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

substituting dashes in files

Status
Not open for further replies.

olmos

Technical User
Oct 25, 2000
135
US
I have a group of files with the name as
such: John_Smith05-04-13.txt
Marge_Doe-Johnson05-04-13.txt
and need to rename them to remove the dash only after any number, so that it will be
like Marge_Doe-Johnson050413.txt

How can I do that ?
sed command ....

thanks,
olmos
 
Code:
echo 'Marge_Doe-Johnson05-04-13.txt' | sed 's/\([0-9]\)-/\1/g'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top