I am trying to find all .xml
file in a Linux directory and convert them to .csv
by:
find . -name "*xml" -execdir sh -c 'xsltproc -o "${0%.xml}.csv" opv.xsl "$0"' {} \;
but the following error occurred:
warning: failed to load external entity "opv.xsl"
cannot parse opv.xsl
I have already installed the xsltproc
package by conda install -c anaconda libxslt
.
I believe you want to use -exec
rather than -execdir
. The difference is that -execdir
executes the command in the directory containing each found file, but those directories won't contain your stylesheet. Alternatively, provide a full path to the stylesheet file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.