Sorry, for code-historical reasons this was unnecessarily complicated.
Should be:
MY_DIR = '/my/path/to/dir'
FILES = os.listdir(MY_DIR)
def grep(regex):
output = []
for f in FILES:
command = "egrep " + '"' + regex + '" ' + MY_DIR + '/' + f
result = subprocess.getoutput(c
On May 11, 8:04 am, Jaroslav Dobrek wrote:
> Hello,
>
> I wrote the following code for using egrep on many large files:
>
> MY_DIR = '/my/path/to/dir'
> FILES = os.listdir(MY_DIR)
>
> def grep(regex):
> i = 0
> l = len(FILES)
> output = []
> while i < l:
> command = "egrep