import os, re

r = re.compile("([a-zA-Z]+)([0-9]+)")
for i in (os.walk(".")):
fn = i[0][2:].strip()
if len(fn) < 3 :
continue
fn2 = fn.upper()
fn3 = r.match(fn2)

try:
if fn.find('-') > 0 and fn3.group(1).isupper() :
print('In if %s' % fn)
continue
print("A=%s" % ( fn3.group(1)))
print("B=%s" % ( fn3.group(2)))
print("mv %s %s-%s" % (fn, fn3.group(1), fn3.group(2)))
except Exception as e:
print('exception: %s' % e)
print('In except %s' % fn)
if fn[1].islower():
print("mv %s %s" % (fn, fn.upper() ))

 

 

 

import os, re

r = re.compile("([a-zA-Z]+)([0-9]+)")
for i in (os.walk(".")):
  fn = i[0][2:].strip()
  if len(fn) < 3 :
    continue
  if fn.find('-') > 0 :
    continue
  fn2 = fn.upper()
  fn3 = r.match(fn2)
  try:

   print("mv %s  %s-%s" % (fn, fn3.group(1), fn3.group(2)))

  except:

   print(fn)

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 hlolo 的頭像
    hlolo

    hlo日記

    hlolo 發表在 痞客邦 留言(0) 人氣()