On Aug 5, David Smith said: >On Tue, 2003-08-05 at 09:37, Jeff 'japhy' Pinyan wrote: >> You didn't show us how you tried running the program. I'll show you first >> how to change the +'s to _'s. But I need to know WHICH numbers should be >> removed from the filename. All of them (except for the 3 in mp3), or just >> those at the beginning of the filename? >> >> ./rename 'tr/+/_/' files >> >> or >> >> ./rename 's/\+/_/g' files > >Here is a sample filename: >00000508+GREATER VISION+SCARS & STRIPES+00.0.MP3 >I noticed after I emailed it that the number code has exactly 11 numbers >(besides the 3 in mp3), so I created a do...while loop to take out the >numbers. The expression I used looked like this //[0-9]// then the >directory /home/user/*. This seemed to have worked for the numbers. > >I noticed another problem though how do you use expressions to take away >one '.'. See in in the time between mins and seconds there is a period.
Then here's what I suggest: ./rename 'tr/+/_/; s/^\d+_//; s/_\d\d\.\d//' ... The first piece changes +'s to _'s. The second piece removes the leading digits and _. The third piece removes the last _, followed by the time signature. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]