Skip to content

Instantly share code, notes, and snippets.

@thirdknife
Created April 24, 2016 19:19
Show Gist options
  • Select an option

  • Save thirdknife/d8996fb90cb3002114171f950cd63c56 to your computer and use it in GitHub Desktop.

Select an option

Save thirdknife/d8996fb90cb3002114171f950cd63c56 to your computer and use it in GitHub Desktop.
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):
if start_dataset in line:
start_pos = num
if end_dataset in line:
end_pos = num
line = line.replace(" ", "")
#if line != "\n":
#print(line.split(";"))
lines = open(filehandle).readlines()
for x in range(start_pos, end_pos):
print(lines[x])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment