简体   繁体   English

Perl终端中的输入和输出文件

[英]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. 未从STDIN读取echo
  • You have an unmatched ' . 您拥有无与伦比的'
  • \\x{\\x{9000} should be \\x{9000} . \\x{\\x{9000}应该是\\x{9000}
  • The range of characters you are removing is very peculiar, and surely incorrect. 您要删除的字符范围非常特殊,并且肯定不正确。 It starts in the middle of a seemingly arbitrary block, and it includes a huge swath of space that's not just unassigned, but not part of any blocks. 它从看似任意的块的中间开始,并且包括巨大的空间,不仅是未分配的,而且不是任何块的一部分。 I'm unable to fix this without more information. 没有更多信息,我将无法解决此问题。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM