小编Sir*_*rga的帖子

如何用大写字母替换特定字符?

请考虑以下字符串

String = "这是为了测试.我是perl的新手!请帮助.你可以帮忙吗?我希望如此."

在后上面的字符串.?!下一个字符应为大写.我怎样才能做到这一点?

我正在逐行读取文本文件,我需要将修改后的数据写入另一个文件.

对你的帮助表示感谢.

perl

4
推荐指数
1
解决办法
5505
查看次数

如何在现有文件的midle中插入一行

考虑一个例子,我想在特定模式匹配时插入几行文本(如果$ line = ~m /这里有几行/然后在下一行插入行):

*current file:*

"This is my file and i wanna insert few lines in here  and other
text of the file will continue."

*After insertion:*

"This is my file and i wanna insert few lines in here  this is my
new text which i wanted to insert and other text of the file will
continue."
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

my $sourcename = $ARGV[1];
my $destname = $ARGV[0];
print $sourcename,"\n";
print $destname,"\n";
my $source_excel = new Spreadsheet::ParseExcel;  
my …
Run Code Online (Sandbox Code Playgroud)

perl

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

perl ×2