更新时间:2022-12-28 16:09:48
尝试:string data = File.ReadAllText(path);
data = data.Replace( , ,);
File.WriteAllText(路径,数据);
忘记数据! :doh:[/ edit]
在类似unix的shell(例如,Cygwin):
perl -pi.bak -es / /, /G; filename_to_process
在命令提示符(DOS shell)中,假设perl.exe的位置在路径上:
perl.exe -pi.bak -es / /,/ g; filename_to_process
应该这样做......
arun 36985
arrunav 25871
elarital 48734
depaal 43212
sujan 23467
my data is up to 2000+ lines it is in notepad as shown in above for that data how can i replace space with comma?
arun,36985
arrunav,25871
elarital,48734
depaal,43212
sujan,23467
Try:string data = File.ReadAllText(path); data = data.Replace(" ", ","); File.WriteAllText(path, data);
[edit]Forgot the data! :doh:[/edit]
At a unix-like shell (e.g., Cygwin):
perl -pi.bak -e "s/ /,/g;" filename_to_process
In a Command Prompt (DOS shell) assuming the location of perl.exe is on the PATH:
perl.exe -pi.bak -e "s/ /,/g;" filename_to_process
ought to do it...