根据读取日志 移动文件

#coding=utf-8

import  os
import  shutil

fobj = open(‘F:/v3/k.txt‘,‘r‘)
line = fobj.readline()
while line:
    if line.find(‘a‘) >=0 :
        line = line.strip(‘\n‘)
        line = line.split(‘ ‘)
        line = line[-1]
        smd5 = line.split(‘\\‘)
        smd5 = smd5[-1]
        print(line)
        if os.path.exists(line):
            newplace=‘F:/v3/manual/a/‘
            #print(newplace+smd5)
            shutil.move(line,newplace+smd5)
    elif line.find(‘b‘) >= 0 :
        line = line.strip(‘\n‘)
        line = line.split(‘ ‘)
        line = line[-1]
        print(line)
        smd5 = line.split(‘\\‘)
        smd5 = smd5[-1]
        if os.path.exists(line):
            newplace=‘F:/v3/manual/b/‘
            #print(newplace+smd5)
            shutil.move(line,newplace+smd5)

    line = fobj.readline()

fobj.close()
print(‘over‘)

  

根据读取日志 移动文件,布布扣,bubuko.com

根据读取日志 移动文件

上一篇:C# 把字符串类型日期转换为日期类型


下一篇:Connecting Universities