Apply iconv to all of the files in a directory
20,675
cd path-to-source-directory
find . -name "*.srt" -exec iconv -f CP1256 -t UTF-8 {} -o path-to-destination-directory/{} +
Example:
If source-directory is called SOURCE and destination-directory is called DESTINATION and both directories are located on the desktop, then path-to-source-directory is ~/Desktop/SOURCE
and path-to-destination-directory is ~/Desktop/DESTINATION
Related videos on Youtube
Author by
quetzal
Updated on September 18, 2022Comments
-
quetzal over 1 year
While trying to convert a collection of .srt files:
iconv -f cp1256 -t utf-8 directory/* > target/*
it converts all of the 22 files in the directory to one file in the target directory called *. I want the processed files to appear separately in the target directory. Can anybody help?
-
Honza over 8 yearsfind: Only one instance of {} is supported with -exec ... + :(