#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Get Lines Python Script

from sys import argv, stdout # Imports arguments and stdout from sys

oldFile = argv[1] # The path for the file we want to modify
newFile = argv[2]
find = argv[3:] # The array of different strings we want to look for (every argument after the first one)

n = open(newFile,"w") # Open new file in write mode


for line in open(oldFile): # For every line in the old file
        for string in find:
            if string in line:     # Check for find string
                n.write(line)      # If it exists, write it to new file

n.close() # Close the new file

printFind = "[{0}]".format(", ".join(str(i) for i in find))

print("\rPrinted every line that contained "+printFind+" to file: "+newFile)