Created
January 17, 2021 19:56
-
-
Save bDrwx/67eb2cd23737210760e2286dc1807345 to your computer and use it in GitHub Desktop.
Bulk upload
This file contains 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
import re | |
import itertools as it | |
def get_file_seq_num(filename: str) -> int: | |
''' CF0001.D00''' | |
match = re.search(r"CF(\d{4}).D00", filename) | |
if match: | |
return int(match.group(1)) | |
return None | |
def get_file_name(seq: int) -> str: | |
return f'CF{seq:04}.D00' | |
def get_file_list(last_file, current_file): | |
for z in it.islice(it.cycle(range(1000)), 300, 325): | |
print(z) | |
if __name__ == "__main__": | |
print(get_file_name(327)) | |
print(get_file_seq_num('CF0999.D00')) | |
get_file_list('CF0300.D00', 'CF0320.D00') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment