I have several files that I want to process with awk and afterwards pipe the outputs of awk to seperate files. I want to process a single file with awk and write the output to a file, but combining that with find and xargs is problematic for me.
This is the current command:
find ./*.data -print0 | xargs -0 -I{} awk '/^00/ {printf "Data: %s"$0;}' > {}.processed
This only creates a file and combines all processed data by awk into a single file named
"{}.processed"
.
What is the correct way of writing all output data to separate files?
The filenames of the output for the files "file1.data" and "file2.data" should be:
file1.data.processed
file2.data.processed