6

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?

karel
  • 122,292
  • 133
  • 301
  • 332
quetzal
  • 63

1 Answers1

8
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

karel
  • 122,292
  • 133
  • 301
  • 332