-
Notifications
You must be signed in to change notification settings - Fork 0
/
listWaveFilesAgain.py
executable file
·66 lines (44 loc) · 1.32 KB
/
listWaveFilesAgain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import os
import glob
import shutil
import time
# file location to check
directorySource = 'D:\k\Projects\LessonsAudio'
#directorySource = 'G:\STEREO\FOLDER03'
# file destination
directoryDestination = 'D:\k\Projects\LessonsAudio'
instructor = 'BobGoins'
className = 'FretboardTheory'
# files I'm looking for
mask='{}\*[0-9].wav'.format(directorySource)
for pathSource in glob.glob(mask):
#print pathSource
(dirName, fileNameFull) = os.path.split(pathSource)
#print dirName
#print fileNameFull
fileName, extension = fileNameFull.split('.')
#print fileName
#print extension
dateStr, timeStr = fileName.split('-')
#print timeStr
#print dateStr
day = dateStr[-2:]
#print day
#month = dateStr[-4:-2]
month = dateStr[2:4]
#print month
year_2_digits = dateStr[:2]
#print year_2_digits
year = "20" + year_2_digits
#print year
dateWithDashes = year + '-' + month + '-' + day
#print dateWithDashes
fileNameDestination = dateWithDashes + '-' + className + '-' + instructor
#print fileNameDestination
pathDestination = directoryDestination + os.path.sep + fileNameDestination + '.wav'
print "\n"
print " source = %s" % pathSource
print "destination = %s" % pathDestination
#shutil.copyfile(pathSource,pathDestination)
#break
print "\n"