N
N
Netscout2015-12-25 19:40:35
linux
Netscout, 2015-12-25 19:40:35

How to run iconv to transcode all files in a directory?

Hello !
I ran into a situation - I need to recode several tens of thousands of text files from cp1251 encoding to utf8.
The command is great for this: iconv -f cp1251 -t utf8 * -o *
(a single launch is: iconv -f cp1251 -t utf8 source.txt -o final.txt)
But it gives an error: "The list of arguments is too long"
Like me to make it work with such a list of arguments?
In a directory with a couple of hundred files, it works out with a bang, but when they're done, it doesn't want to.
Thanks for the tips!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
romy4, 2015-12-25
@Netscout

find -name "mask" -exec iconv -f cp1251 -t utf8 {} -o конечный{} \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question