Hi, I tried looking for my answer here and many other forums and although some were close, it didn't completely do it for me so I planned to post it.
I have a bunch of files in a folder(say C:\Test) and they need to be renamed in a standardized format-

The files shown below-
ChargeOptimisation_january2011.csv 20110101_Bill_inventory.csv Account_20110101_Summary.csv
needs to be renamed to -
ChargeOptimisation.csv Bill_inventory.csv Account_Summary.csv

I need to use keywords like 'ChargeOptimisation','Bill_inventory' as the other characters may be random. Can someone please help me with using regular expressions / rename command to solve this problem.

Thanks, Rohan.

In reply to Renaming files based on keywords by rohanan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.