I have a folder with many subfolders and files in them and need to extract only some of those documents (based on part of the filename).
So I am thinking something like find /location -name *string* | xargs do_something would be the sort of command I need.
however the file where not created with such a situation in mind. File- and foldernames are full of spaces.
$ find /path/to/folder -name *FISI*
/path/to/folder/2012 Sommer/AP S2012 IT GA1 FISI Löser.pdf
/path/to/folder/2012 Sommer/AP S2012 IT GA1 FISI.pdf
/path/to/folder2013_14 Winter/AP W2013 IT GA1 FISI Löser.pdf
...
...
so any command I pipe this through to will not be able to work because it can not identify those files.
Is there any way around this? I.e. If you could batch-replace the spaces in file/foldernames with underscores or such. The list is much longer then what ist visible above, so I need some sort of automation.
<command> is a command to execute for every result, so could be used to strip spaces using sed and appending the result to a text file, which can, in turn, be read by another script.
IMPORTANT NOTE:
In the <command> to execute, {} is used as placeholder for the complete filename and path. For example: