My document.tex
where I want to get the list of files, and grep those files with the term gastric
\subimport{}{1.2_protocal_answers.tex}
\subimport{}{2_protocol_answers.tex}
1.2_protocal_answers.tex
content:this is a gastric juice lorem content
2_protocol_answers.tex
content:this is a second gastric\n test file
My .pdf output is broken, but I need to search the contents in the material. My Directory is too massive to do it for all, which can be done with Geany's Find in Files
. I would like to do dependent search on the files that are imported in the file.
Attempts
Pseudocode where I cannot get the list of files in the .tex document
find ./document.tex -type f -exec \ grep -E '\subimport{[A-Za-z1-9_-]*} {} \; # TODO search the list of files with the word `gastric`
Any IDE approach? My favorite IDE uses
grep
internally so I thinkfind-grep
approach is the most appropriate here.
System: Ubuntu 16.04, 64 bit
Grep: grep (GNU grep) 2.25
Find: find (GNU findutils) 4.7.0-git
Hardware: Macbook Air 2013-mid
Linux kernel: 4.6
grep
as their internal machine. But I think you are right. It can be done in two steps. Please, consider an answer so I can better understand your proposal.