I am using the following command:
find . -name *.queryInputs -ls | sort -k 8,10
This gives me a list of files that are sorted by date. It is basically ls -la returning only files ending in queryInputs. I would like to take the list of files and print the file name followed by a matching string found in each file. I don't want to use grep because it prints the entire line that the match occurred in. I am trying to find the string:
queryName: '<name>'
Where <name> varies from file to file. I want to print the value of <name> after the file name.
Is this possible?
Thank you for your help,
Al
find . -name *.queryInputs -ls | sort -k 8,10
This gives me a list of files that are sorted by date. It is basically ls -la returning only files ending in queryInputs. I would like to take the list of files and print the file name followed by a matching string found in each file. I don't want to use grep because it prints the entire line that the match occurred in. I am trying to find the string:
queryName: '<name>'
Where <name> varies from file to file. I want to print the value of <name> after the file name.
Is this possible?
Thank you for your help,
Al