Created
April 24, 2016 19:21
-
-
Save thirdknife/d8fbe2f6d6f04ef37cc0e5b43ad7eac9 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
| def get_dataset(filehandle, start_dataset,end_dataset): # dataset_type : Dataset_01, Dataset_02, Dataset_03 or Dataset_04 | |
| dataset = [] | |
| with open(filehandle) as lines: | |
| for num, line in enumerate(lines, 1): | |
| line = line.replace(" ", "") | |
| if start_dataset in line: | |
| start_pos = num | |
| if end_dataset in line: | |
| end_pos = num | |
| #if line != "\n": | |
| #print(line.split(";")) | |
| lines = open(filehandle).readlines() | |
| for x in range(start_pos, end_pos): | |
| lines[x] = lines[x].replace(" ", "") | |
| print(lines[x]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment