#!/usr/bin/env python
 
import re
 
#Initialization of important variables
InFileName = "order2589010.html"
InFile = open(InFileName, 'r')
InFileTwo = open(InFileName, 'r')
FileLines = InFileTwo.readlines()

NameOligos = []
SeqOligos = []
LineNumber = 0

for Line in InFile:
		GoodLine = re.search("bp", Line)
		if GoodLine != None:
			
			# Ajout de la sequence dans la liste des Oligos
			SearchOligo = re.search("<td>([\w, ]+)", Line)
			SeqOligo = str(SearchOligo.group(1)).replace(" ","")
			SeqOligos += [SeqOligo] 
			
			# Ajout du nom de la sequence dans la liste des noms
			SearchName = re.search("<td>([\w, ,/,-]+)", FileLines[LineNumber - 5])
			NameOligo = str(SearchName.group(1)).strip()
			NameOligos += [NameOligo]
			
		#Incrementation des lignes
		LineNumber += 1
	
InFile.close()
InFileTwo.close()
LineNumber = 0

