No. Because its hard to read code (especially python) without code tags
import re
infileName1 = raw_input("Enter filename ")
infile1 = open(infileName1, 'r')
data1 = infile1.readlines()
outfile = open("test.txt", 'w')
for line in data1:
parameters = line
if re.search("KEYWORD",line):
count = 1
for i in range(count):
outfile_temp.write(parameters)
So to solve this we first need to get around how to skip four lines ahead after finding the keyword. We shall do this byenumerating. This is used so that every loop of the 'for line in data1' it will also have a number of how many times it has looped. Great for knowing how many lines you have gone through.
So
for index, line in enumerate(data1):
#now index is the line it is on, line is still just the same as before Now we need to skip four lines and keep the code going
so
#we could do something like this
if re.search(KEYWORD, line):
index += 4
#and then we just read the index of the file, that way we get the line 4 places ahead of where the loop is at
#but we still need to find n!
n = int(raw_input("Enter n"))
for f in range(n):
print(data1[index])
Now i have started you off, try and put it together and try starting the file writing bit.
Hope that helps :)