Jun-21-2021, 11:15 AM
(Jun-21-2021, 10:02 AM)snippsat Wrote:(Jun-21-2021, 07:55 AM)Laplace12 Wrote: Alright, I now figured I can maybe try to iterate n and then loop over the lines I want:I still hard-coded lines as you most type them.
To give a example where find similarity in data set,then parse line under this.
found = False with open('data_set.txt') as f,open('output.txt', 'w') as f_out: for line in f: if not '#' in line and not 'Data' in line and found: f_out.write(line) else: found = True
Output:Value1 Value2 Value1 Value2
Oh I see - thanks a lot, this works perfectly!