edit · print · PDF

Please note that all the SIEpedia's articles address specific issues or questions raised by IAC users, so they do not attempt to be rigorous or exhaustive, and may or may not be useful or applicable in different or more general contexts.

Script to find a text sequence in files of a given extension, in a tree of directories

R Azzollini

#! /usr/bin/env python
''):
    """Script to find a text sequence in files of a given extension, in
    a tree of directories."
""
    # IMPORT STUFF
#from mystop import stop # ONLY LOCAL
# END IMPORT
'\nExecuting find_sequence...''Another amazing aplication by Ruyman Azzollini\n''\nSequence : %s''Extension''Tag''%s : %s''tmpFiles%s.txt''%f''.','_''''''/''/''find %s* > %s''r''rm %s''No Files to Check in current directory'''"%s"'tmpGrep%s.txt''%f''.','_''cat %s | grep %s %s > %s''r''rm %s''\n%s\n''\n'#stop()

########################################################################
"__main__"#from mystop import stop
"-e","--extension",dest="extension""Extension of files to fetch. Optional.""-t","--tag",dest="tag""Sequence in file names to fetch. Optional.""-s","--sequence",dest="sequence""Sequence to find inside files. Optional.""-p","--path",dest="path""Directory to examine. Optional.""-g","--grep",dest="grepopt"''"Options to pass to the grep command. \nExample: -g '-i'\nOptional."''

Section: HOWTOs

edit · print · PDF
Page last modified on April 07, 2008, at 11:03 PM