How can I combine every two rows of a string into a paired list of lists?
my code is getting strings from text file:
for fp in oxi_filepath:
with open(fp, 'r') as dat_file:
data = dat_file.readlines()
filteredData = list(filter(lambda x: any(True for c in keywords if c in x and 'Value="/' not in x
and 'Value="27' not in x and 'd3333-3333d' not in x), data))
for row in filteredData:
result = re.search(self.regexpattern, row)
if result:
ocr_micr_l.append(result.group(1))
print filtered data...Example
My name is Chris
I like Burgers
My name is John
I like Chicken
output
[['My name is Chris', 'I like Burgers'],['My name is John', 'I like Chicken']]