You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
325 B
Python
14 lines
325 B
Python
10 years ago
|
#!/bin/env python
|
||
|
|
||
|
import os
|
||
|
|
||
|
for root, dirs, files in os.walk('txt'):
|
||
|
for filename in files:
|
||
|
oldpath = os.path.join(root, filename)
|
||
|
f = open(oldpath)
|
||
|
firstline = f.readline()
|
||
|
f.close()
|
||
|
if firstline.startswith("\fT E R R A N O V A"):
|
||
|
newpath = os.path.join("terranova", filename)
|
||
|
os.rename(oldpath, newpath)
|