[英]Input and output file in perl terminal
Please something wrong in this code, in input and output, i don't know how i can correct this code: 请在输入和输出中此代码中出现错误,我不知道如何纠正此代码:
echo < in.txt | perl -CS -pe 's/[\x{0830}-\x{\x{9000}]+//g > out.txt
The problem how i can import in.txt
and export out.txt
. 我如何导入
in.txt
和导出out.txt
。
In sed it's easy like this 在sed中,这样很容易
sed < in.txt > out.txt
echo
doesn't read from STDIN. echo
。 '
. '
。 \\x{\\x{9000}
should be \\x{9000}
. \\x{\\x{9000}
应该是\\x{9000}
。 Fixed: 固定:
perl -CS -pe's/[\x{0830}-\x{9000}]+//g' <in.txt >out.txt
or just 要不就
perl -CS -pe's/[\x{0830}-\x{9000}]+//g' in.txt >out.txt
See also: Specifying file to process to Perl one-liner 另请参见: 指定要处理为Perl单线的文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.