Created
January 18, 2017 14:42
-
-
Save Tony3-sec/6c2612eb5e2cb39f1ee4799913259ff2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import os | |
| import glob | |
| org_ext = '.flow' | |
| new_ext = '.pcap' | |
| print('changing file extension ' + str(org_ext) + ' to ' + str(new_ext) + '...') | |
| ## list the file with certain extension in current directory | |
| files = glob.glob('*' + str(org_ext)) | |
| ## Rename files with new extension | |
| for oldname in files: | |
| newname = oldname.replace(org_ext, new_ext) | |
| os.rename(oldname, newname) | |
| print('Completed!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment