【发布时间】:2017-05-03 15:49:10
【问题描述】:
我需要使用 UTF-8 编码将 20 个 .txt 文件连接成一个。这 20 个文件都在同一个目录中。 你能帮助我吗 ? 我正在考虑类似的事情
use strict;
use warnings;
my $fichier = "*.txt";
open(FIC,">>:encoding(UTF-8)", $fichier) o
close (FIC);
<>;
【问题讨论】:
-
cat *.txt > combined_file.txt -
文件当前使用的编码是什么?为什么你认为你需要 Perl?
-
我需要使用 perl,因为它是我唯一知道的语言,哈哈。而且目前的编码是UTF8
-
因此,如果您使用的是 unixy 系统,请使用@HunterMcMillen 的建议。在 Windows 上,使用
copy /b *.txt combined_file.txt。
标签: perl concatenation