question on write the result of first 50 matched result to txt

week 3 assignment examine case study on learner analysis
October 20, 2021
henri fayol and systematic management
October 20, 2021

question on write the result of first 50 matched result to txt

I am reading a txt file (called file.txt) and filter through the entire file looking for lines start with “>” symbol. I used regular expression to find line starts with “>”. The output of the program is the first 5 matched results with “>”. I attached my code with this post and sample input.

1 #!/usr/bin/env python

2 # testing

3 import re

4

5 match = ”

6 n = 5

7 file = open(“file.txt”,”r”)

8 for i in range(n):

9 if re.match(‘^>’,i):

10 match += i

11

12 out_file = open(“outfile.txt”,’w’)

13 out_file.write(header)

14 out_file.close()

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.