如何使用perl在代码中提供路径地址 [英] how to give a path address in a code using perl
本文介绍了如何使用perl在代码中提供路径地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 strict;
se警告;
my $ file = register.txt;
# 从文件中读取数据
my $ data = slurp( $ file );
# 打印字符串数据
print $ data ;
string $ data = FILE.ReadAllText(path);
$ data = data.Replace( , ,);
file.WriteAllText(path,data);
# 我们只打印数据
print $ data \ n;
close( $ data );
(这是我的代码,如何解决路径?
我的给定数据,如20000行有转换
arunav 1236
askjasi 25986
sdhfuis 26897
krotri 6598548
我想要输出
arunav,1236
askjasi,25986
sdhfuis,26897
krotri,6598548
can请帮帮我
解决方案
file = register.txt;
# 从文件中读取数据
my
数据= slurp(
file );
# 打印字符串数据
use strict;
se warnings;
my $file=register.txt;
#read the data from file
my $data= slurp($file);
#print the string data
print $data;
string $data = FILE.ReadAllText(path);
$data = data.Replace(" ",",");
file.WriteAllText(path,data);
#we will just print the data
print "$data\n";
close($data);
(this is my code in that howto address the path ?
my given data like this 20000 lines are there to convert
arunav 1236
askjasi 25986
sdhfuis 26897
krotri 6598548
I want output
arunav,1236
askjasi,25986
sdhfuis,26897
krotri ,6598548
could please one help me
解决方案
file=register.txt; #read the data from file my
data= slurp(
file); #print the string data print
这篇关于如何使用perl在代码中提供路径地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文