[TxMt] Re: How can I save 100+ files with a different encoding format?
Christian Rosentreter
karibu at gmx.net
Mon Jan 11 09:28:06 UTC 2016
Hello there,
> On 11 Jan 2016, at 9:51 AM, J Galt <jgaltusa at gmail.com> wrote:
>
> Do I execute this from the terminal?
>
> I tried to but it returned the following error:
> -bash: -type: command not found
>
Yes, from Terminal. The "$" in my example symbolises a common Terminal prompt. So you type everything starting with "find" (skip the "$") and replace "sourcedir" and "/path/to/destdir/" with respective locations on your system.
>> On Jan 10, 2016, at 3:36 AM, Christian Rosentreter <karibu at gmx.net> wrote:
>>
>> IMHO, such task is a job for some command line magic. :-)
>>
>> Something like this could do:
>> $ find sourcedir -type f -execdir sh -c 'iconv -f iso-8859-1 -t utf-8 "{}" > /path/to/destdir/"{}"' \;
>>
>> This command line uses iconv to convert all files from "sourcedir" and put the result of the conversion into "destdir".
>
>
regards,
Christian
More information about the textmate
mailing list