python script for finding files from a list -


i trying write unix script. purpose of script read list.txt file contains various file names without extension. once reads list, need go through files in directory , sub-directory locate files listed extension *.doc or *.pdf. if finds files same file name , extension, creates file found.txt , if files not found creates notfound.txt. both these files (found , not found have file names list.txt have not been found).

i tried using grep command, requires me have updated list everytime search. avoid maintain list , directly directory , sub-directories. suggestions welcome. current code. used find , fgrep think have wrong.

find . -name "*.doc" > output.txt -print0 | xargs -0 fgrep -f my-search-file.txt > my-result-file.txt 

thank you.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -