Skip to content

Instantly share code, notes, and snippets.

@towfiqpiash
Last active February 13, 2019 06:28
Show Gist options
  • Save towfiqpiash/dda706d833fa07ec62f30c3e7c11d113 to your computer and use it in GitHub Desktop.
Save towfiqpiash/dda706d833fa07ec62f30c3e7c11d113 to your computer and use it in GitHub Desktop.

Revisions

  1. towfiqpiash revised this gist Feb 13, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion renamer.py
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,6 @@
    os.rename(dirname + "/" + filename, dirname + "/" + str(filename[5:]))
    #x = int(filename[:-4])
    #os.rename(dirname + "/" + filename, dirname + "/" + str(mynames[x]).rstrip()+".svg")



    ## Thanks Mosharrof Rubel vai for the script :D
  2. towfiqpiash created this gist Feb 13, 2019.
    14 changes: 14 additions & 0 deletions renamer.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    f = open('list.txt', 'r')
    mynames = f.readlines()
    print(mynames)
    f.close()

    import os
    os.getcwd()
    dirname = "/home/piash/Desktop/Test/files/"
    for i, filename in enumerate(os.listdir(dirname)):
    if 'saved' in filename:
    os.rename(dirname + "/" + filename, dirname + "/" + str(filename[5:]))
    #x = int(filename[:-4])
    #os.rename(dirname + "/" + filename, dirname + "/" + str(mynames[x]).rstrip()+".svg")